Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyserial module not listed in the requirements #188

Open
Giakou opened this issue Nov 8, 2022 · 3 comments
Open

Pyserial module not listed in the requirements #188

Giakou opened this issue Nov 8, 2022 · 3 comments

Comments

@Giakou
Copy link

Giakou commented Nov 8, 2022

Hi, is there any reason why pyserial is not listed in the requirements.txt? I have never used basil before, but I just cloned it in development mode and tried to execute a copy of basil/examples/lab_devices/xray_tube.py. This is the traceback:

Traceback (most recent call last):
  File "/home/pxd9/basil/basil/dut.py", line 255, in _factory
    mod = import_module(importname)
  File "/home/pxd9/anaconda3/envs/mosfet_irrad/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/pxd9/basil/basil/TL/Serial.py", line 9, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pxd9/mosfet_irrad/irrad/xray_irrad.py", line 35, in <module>
    device = Dut('xray_basil_config.yaml')
  File "/home/pxd9/basil/basil/dut.py", line 101, in __init__
    self.load_hw_configuration(self._conf)
  File "/home/pxd9/basil/basil/dut.py", line 200, in load_hw_configuration
    self._transfer_layer[intf['name']] = self._factory('basil.TL.' + intf['type'], *(), **kargs)
  File "/home/pxd9/basil/basil/dut.py", line 259, in _factory
    mod = import_module(importname)
  File "/home/pxd9/anaconda3/envs/mosfet_irrad/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'Serial'
@Giakou
Copy link
Author

Giakou commented Nov 8, 2022

This is what pipreqs would give me:

bitarray==2.6.0
cocotb==1.7.1
cocotb_bus==0.2.1
crcmod==1.7
numpy==1.23.4
pyserial==3.5
pytest==7.2.0
pyvisa==1.12.0
PyYAML==6.0
sensirion_shdlc_driver==0.1.5
sensirion_shdlc_sensorbridge==0.1.1
setuptools==65.5.1
six==1.16.0
sphinx_rtd_theme==1.1.1

@leloup314
Copy link
Member

Hi, in general the basil.TL implementations which are build on top of existing modules, such as pyvisa or pyserial are not listed in the requirements it seems. I do not know if this was an intentional design choice at the time to only list core requirements in the .txt and have users install additional things if they need to use corresponding basil parts but one can argue for both. We could think about adding certain things to the requirements

@Giakou
Copy link
Author

Giakou commented Nov 8, 2022

I think that since basil is on PyPi it would make sense to install at least the basic requirements (maybe not their dependencies). But, this is just my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants