abelcarreras / DynaPhoPy

Phonon anharmonicity analysis from molecular dynamics
http://abelcarreras.github.io/DynaPhoPy/
MIT License
113 stars 51 forks source link

No module named 'phonopy' #23

Closed thliu-hust closed 1 year ago

thliu-hust commented 1 year ago

Dear Abel,

I have successfully compiled phonopy-2.14.0 and then dynaphopy-1.17.15. I am certain that the path 'phonopy-2.14.0/lib/python' was added to PYTHONPATH after compiling Phonopy. However, I am still encountering this issue when running dynaphopy. By the way, running phonolammps is everything fine.

File "/home/dynaphopy-1.17.15/lib64/python3.6/site-packages/dynaphopy-1.17.15-py3.6-linux-x86_64.egg/dynaphopy/interface/phonopy_link.py", line 2, in from phonopy.api_phonopy import Phonopy ModuleNotFoundError: No module named 'phonopy'

Thanks,

Te-Huan

abelcarreras commented 1 year ago

Dear Te-Huan,

it seems your problem is related to your instalation of phonopy. For some reason, according to your error phonopy module cannot be found. I observe that dynaphopy is properly installed (using setup.py?) in the site-packages repository. That's probably why it is well detected by phonoLAMMPS with no issues. However is this not the case for phonopy? Is there any reason for not installing it there?

Have you tried to run phonopy independently? Can you import phonopy module from a python script? maybe you can try to install phonopy using pip instead of compiling it from source.

thliu-hust commented 1 year ago

Dear Abel,

Thanks for the prompt reply. Following your instruction, this issue was solved by compiling phonopy strictly as a Python module, which contains a site-packages directory. Another important thing to note is that one needs to manually copy the "./phonopy-**.egg/phonopy" directory from the site to the parent directory; otherwise, Python won't be able to see the phonopy module.

Many thanks,

Te-Huan

abelcarreras commented 1 year ago

Great