powerscorinne / GLRM

MIT License
97 stars 49 forks source link

cannot import name 'GLRM' #5

Open lzdh opened 6 years ago

lzdh commented 6 years ago

Hi, I installed glrm in the conda environment on a cluster, but when I try to import it within the Jupyter notebook forwarded from this cluster, I got this error:

screen shot 2018-02-03 at 11 58 59

Any help is much appreciated.

vsoch commented 6 years ago

hey @lzdh ! Usually when there is an import error, you might be running a python installation that is different from the one you are using. The first thing to do is to ensure that the path that you see ~/anaconda3/xxxxx is the one of the conda that you are targeting. So you would install directly:

~/anaconda3/bin/conda install glrm

Then make sure the jupyter notebook (type which jupyter) is an executable being used in the same installation.

Then I would try importing the class directly. It's having an error when it imports glrm.__init___.GLRM, so give a try to from glrm.glrm import GLRM.

If you don't get insight from the above, if you could give detail to your install and usage procedure so the error can be replicated, that would be very helpful!

lzdh commented 6 years ago

Hi @vsoch Thank you for your reply. My colleague helped me solved the issue. It's a version compatibility problem, and relative import issue. In init.py, glrm.py (on convergence.py) and reg.py (on until.py), there should be relative import instead of absolute. Also we modified the 'print' function to be compatible to python3. I could create a pull request if you'd like glrm to be compatible to pyton3 or maybe make a note in readme file.

vsoch commented 6 years ago

I'm not the maintainer here, but I'm sure @cehorn would appreciate it!

abhiML commented 6 years ago

Was this fixed? I still faced the same problem with python 3.

TomDLT commented 5 years ago

Still not fixed