There's a git repo at https://github.com/Ivancic91/LammpsIO that I can install in "editable" mode by cloning and running pip install -e /path/to/LammpsIO
. When I do this, I'm able to run import LammpsIO
successfully in python.
However, when I pip install directly from github with pip install git+https://github.com/Ivancic91/LammpsIO.git
I run into problems. The actual pip install
command looks successful with the usual success messages:
Successfully built LammpsIO
Installing collected packages: LammpsIO
Successfully installed LammpsIO-0.0.1
But when I try to import LammpsIO, I get ModuleNotFoundError: No module named 'LammpsIO'
.
I thought this might be some sort of path error, but which pip
and which python
both point to the same conda environment folder.
Here are a couple more outputs in case anyone needs them.
After pip install git+...
:
conda list
returns:krb5 1.16.3 h24a3359_1000 conda-forge
lammpsio 0.0.1 pypi_0 pypi
libcurl 7.64.0 h76de61e_0 conda-forge
pip list
returns:kiwisolver 1.0.1
LammpsIO 0.0.1
MarkupSafe 1.1.0
After pip install -e ...
:
conda list
returns:krb5 1.16.3 h24a3359_1000 conda-forge
lammpsio 0.0.1 dev_0 libcurl 7.64.0 h76de61e_0 conda-forge
pip list
returns:kiwisolver 1.0.1
LammpsIO 0.0.1 /path/to/LammpsIO/src
MarkupSafe 1.1.0
I'm guessing this has to do with the unorthodox structure of LammpsIO, whose setup.py
file contains:
package_dir = {'': 'src'},
packages = find_packages(where='src'),
but I'm surprised that pip install from github fails where pip install -e /path
works.
Your reasoning seems sound here. I'd think that what you're trying to would work. I created a new virtualenv and tried the github install myself. I then looked in site-packages. What I see is strange. There's a 'LammpsIO-0.0.1.dist-info' directory containing basic metadata, but no Lammps package itself. I did the find 'find . -iname "*mmps*"' in site-packages, and only got that info directory. So it seems like the package didn't actually install. - LammpsIO does show up when I do "pip list".
If you "install" the package by download a zip and doing "pip install [zip]", you get the same output from pip and end up with the same problem. So it has nothing to do with installing directly from github. It has to do with actually installing the package vs just linking its source into your enviroment .
My guess is that the Lammps installer is just broken - Since '-e' doesn't install anything, but just creates a link, that would explain why it works but a regular install does not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With