ImportError after installing postpic
MerlinPendragon opened this issue · comments
Hi guys, I am trying to install postpic on a cluster. After successfully installed postpic using ./setup.py install
command, I got this error while importing it.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/WORK/pku_bqiao_1/lxb/Misc/postpic/postpic/__init__.py", line 55, in <module>
from . import particles
File "/WORK/pku_bqiao_1/lxb/Misc/postpic/postpic/particles/__init__.py", line 21, in <module>
from . import particles
File "/WORK/pku_bqiao_1/lxb/Misc/postpic/postpic/particles/particles.py", line 28, in <module>
from ._routines import SpeciesIdentifier, histogramdd
File "/WORK/pku_bqiao_1/lxb/Misc/postpic/postpic/particles/_routines.py", line 30, in <module>
from . import _particlestogrid as ptg
ImportError: cannot import name '_particlestogrid' from 'postpic.particles' (/WORK/pku_bqiao_1/lxb/Misc/postpic/postpic/particles/__init__.py)
I'm using the following python version
'3.7.3 (default, Mar 27 2019, 22:11:17) \n[GCC 7.3.0]'
Here is the output of ./setup.py install
install.log
It seems in your error message python is trying to import postpic from the source path /WORK/pku_bqiao_1/lxb/Misc/postpic/postpic
and not the installed location /WORK/pku_bqiao_1/lxb/local/anaconda3/lib/python3.7/site-packages/
. Sometimes this happens if the python interpreter was already running from before the installation.
Could you make sure that you run a fresh instance python interpreter, possibly from a different directory? This should then import the installed version, including the compiled _particlestogrid
module. Also make sure you actually are running the your anaconda
python which postpic has been installed to.
Ahh, brilliant! I should run a python interpreter elsewhere. The problem is fixed now. Thanks!