risilab / cormorant

Codebase for Cormorant Neural Networks
Other
60 stars 11 forks source link

Install & Import issue #2

Open Nanco-L opened 3 years ago

Nanco-L commented 3 years ago

Hello, I try to install and use cormorant in my environment (Python 3.6)

First, install command suggested in the README pip install cormorant . is not working in my environment. In addition, after installing cormorant via python setup.py install command, import cormorant command is not working in Python following the error message below:

>>> import cormorant
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sr6/kyuhyun9.lee/env_ML/lib/python3.6/site-packages/cormorant-0.1.0-py3.6.egg/cormorant/__init__.py", line 1, in <module>
    from cormorant import cg_lib
  File "/home/sr6/kyuhyun9.lee/env_ML/lib/python3.6/site-packages/cormorant-0.1.0-py3.6.egg/cormorant/cg_lib/__init__.py", line 8, in <module>
    from cormorant.cg_lib.cg_ops_tau import cg_product_tau
  File "/home/sr6/kyuhyun9.lee/env_ML/lib/python3.6/site-packages/cormorant-0.1.0-py3.6.egg/cormorant/cg_lib/cg_ops_tau.py", line 3, in <module>
    from cormorant.so3_lib import SO3Tau
  File "/home/sr6/kyuhyun9.lee/env_ML/lib/python3.6/site-packages/cormorant-0.1.0-py3.6.egg/cormorant/so3_lib/__init__.py", line 8, in <module>
    from cormorant.so3_lib import so3_tau, so3_torch, so3_tensor
  File "/home/sr6/kyuhyun9.lee/env_ML/lib/python3.6/site-packages/cormorant-0.1.0-py3.6.egg/cormorant/so3_lib/so3_torch.py", line 2, in <module>
    import cormorant.so3_lib.rotations as rot
AttributeError: module 'cormorant' has no attribute 'so3_lib'

I manually change the line in problem https://github.com/risilab/cormorant/blob/6a4b6370e8a7cfd7bf253ecfb5783b6d7787ba3f/src/cormorant/so3_lib/so3_torch.py#L2 like below:

from cormorant.so3_lib import rotations as rot

then import process work without any error.

What is the reason of that problem? Version of Python in my environment? If it is correct, it will be nice to change the README!

AllanSCosta commented 3 years ago

Hi there,

I just ran into the same issue. Thanks for sharing, your solution fixed.

EAkeweje commented 3 years ago

Thanks for sharing this. Your solution fixed installation issues. The.py files in example file worked!

However, for some strange reasons import cormorant didn't work in colab notebook. Just for anyone who would want to use this repo for their future projects on colab, I decided to share what I eventually found. Instead of using!pip install cormorant . one should use!pip install . Everything works smoothly with this.