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

import xswap requires numpy but setup.py does not include this dependency #23

Open
dhimmel opened this issue Aug 25, 2019 · 3 comments
Open

Comments

@dhimmel
Copy link
Member

dhimmel commented Aug 25, 2019

>>> import xswap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dhimmel/anaconda3/envs/xswap/lib/python3.7/site-packages/xswap/__init__.py", line 1, in <module>
    from xswap import network_formats
  File "/home/dhimmel/anaconda3/envs/xswap/lib/python3.7/site-packages/xswap/network_formats.py", line 3, in <module>
    import numpy
ModuleNotFoundError: No module named 'numpy'

I think we wanted users without numpy to be able to use the package, right? So we should probably just make the numpy import lazy.

Also you may want to specify extras_require in setup.py for users who want to install the extra dependencies.

@dhimmel
Copy link
Member Author

dhimmel commented Aug 25, 2019

Similar issue with scipy:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-a8f39505b870> in <module>
----> 1 import xswap

~/anaconda3/envs/xswap/lib/python3.7/site-packages/xswap/__init__.py in <module>
----> 1 from xswap import network_formats
      2 from xswap import preprocessing
      3 from xswap import prior
      4 from xswap.permute import permute_edge_list
      5 

~/anaconda3/envs/xswap/lib/python3.7/site-packages/xswap/network_formats.py in <module>
      2 
      3 import numpy
----> 4 import scipy.sparse
      5 
      6 

ModuleNotFoundError: No module named 'scipy'

@dhimmel
Copy link
Member Author

dhimmel commented Aug 25, 2019

And pandas:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-a8f39505b870> in <module>
----> 1 import xswap

~/anaconda3/envs/xswap/lib/python3.7/site-packages/xswap/__init__.py in <module>
      1 from xswap import network_formats
      2 from xswap import preprocessing
----> 3 from xswap import prior
      4 from xswap.permute import permute_edge_list
      5 

~/anaconda3/envs/xswap/lib/python3.7/site-packages/xswap/prior.py in <module>
      2 
      3 import numpy
----> 4 import pandas
      5 import scipy.sparse
      6 

ModuleNotFoundError: No module named 'pandas'

@dhimmel
Copy link
Member Author

dhimmel commented Aug 25, 2019

BTW these errors are using https://github.com/hetio/xswap/releases/tag/v0.0.2 which is 6 commits behind master currently.

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

1 participant