Closed CharString closed 2 years ago
The behaviour is very erratic. Sometimes it is fixed by installing editables by hand
$ pdm run pip install editables
...
Successfully installed editables-0.2
$ pdm run python foo.py
$ # no error
And then I can even uninstall
$ pdm run pip uninstall editables
Found existing installation: editables 0.2
...
Successfully uninstalled editables-0.2
$ pdm run python foo.py
$ # foo keeps working. No error, even though the module isn't there anymore:
$ pdm run python -c 'import editables'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'editables'
I have no idea where the editables package should be. As this adding editables to the virtualenv doesn't always work. I tried adding it to my project dependencies with pdm add editables
, and then it is installed in the venv, but it still raises the Error when I try to run stuff in the project.
So apparently my editable installed packages end up in the site-packages under lib64
, but editables
is in the site-packages under lib
. When I symlink to it under lib64
the errors disappear.
I have no idea what to make of this. Or what the situation ought to look like.
Thanks for reporting, it is a bug with PDM project and has been fixed in the main branch. Plan to release the fix in about 3 days
@frostming
I've just tested with version 1.11.2 in one of my projects, and when I re-run lock
it does add ")editables" to the dependencies of my editable dependencies. But sync
or install
still install 'editables' under .lib in the venv, not under ./lib64.
Creating a symlink under lib64 helps.
Is this a bug in editables? Or are we creating the .pth files incorrecly?
lib64 is for platform libraries(those with C-extensions), and lib is for pure python libraries, editables belong to the latter.
Many commands raise
ModuleNotFoundError: No module named 'editables'
after installing the project withpdm install
To Reproduce I have setup a repo to illustrate:
It's named after pdm-project/pdm#649, but that one was solved, because using pep582 works fine.
Expected behavior I expect the same behaviour as without the plugin. When I remove the venv and use pep582 it works:
Screenshots
System (please complete the following information):