Closed 2m closed 4 years ago
Hmm, that's peculiar. Could you show me the output of these commands?
which python
which pip
pip list
which poetry
poetry debug info
poetry run which python
poetry run which pip
poetry run pip list
Also, do these commands work?
python -c 'import jinja2'
poetry run python -c 'import jinja2'
Could you show me the output of these commands?
Sure. Just note that the ModuleNotFoundError
I mentioned in the original post shows up on every invocation of python
, so the output is a bit noisy.
Also, do these commands work?
─╼ python -c 'import jinja2'
Error processing line 1 of /home/martynas/.local/lib/python3.8/site-packages/zzz_poetry_dynamic_versioning.pth:
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/home/martynas/.local/lib/python3.8/site-packages/poetry_dynamic_versioning/__init__.py", line 7, in <module>
import jinja2
ModuleNotFoundError: No module named 'jinja2'
Remainder of file ignored
Seems to work: the exit code is 0
.
─╼ poetry run python -c 'import jinja2'
Error processing line 1 of /home/martynas/.local/lib/python3.8/site-packages/zzz_poetry_dynamic_versioning.pth:
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/home/martynas/.local/lib/python3.8/site-packages/poetry_dynamic_versioning/__init__.py", line 7, in <module>
import jinja2
ModuleNotFoundError: No module named 'jinja2'
Remainder of file ignored
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'jinja2'
And this one does not.
I was able to reproduce this in an Arch VM (with pip install
) as well as an Ubuntu VM (with pip3 install --user
). Apparently, it's specifically broken for user installs, and I didn't notice it before because my Linux test VM does non-user installs by default. For now, you should be able to avoid the issue by doing sudo pip install poetry-dynamic-versioning
, but I'll try to see if there's a better solution.
I see. Thanks for looking into it.
An idiomatic way to install a python package globally in Arch Linux would be to create a PKGBUILD for it ant let pacman install it. I will try to write a PKGBUILD for poetry-dynamic-versioning
.
I was able to create an Arch Linux package for poetry-dynamic-versioning
and install it globaly by using https://github.com/anntzer/pypi2pkgbuild
pypi2pkgbuild.py poetry-dynamic-versioning
Everything works as expected now!
I've also come across this issue. Removing poetry
installation made by get_poetry.py
script and switching to pip user installation helped.
I am running latest ArchLinux. Installing
poetry-dynamic-versioning
withpip install
installs it to the~/.local/lib/python3.8/site-packages/poetry_dynamic_versioning
directory:However then when running
poetry build
in a poetry project directory I get the following error:But
jinja2
is available in system-wide packages:/usr/lib/python3.8/site-packages