-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--sync removes pkg-resources, leading to pillow error #6758
Comments
There's not enough detail here to reproduce this (where is a preinstalled pkg_resources coming from?) -- here's what I tried: docker run --rm -i --entrypoint /bin/bash python:3.8 <<EOF
curl https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - --version 1.2.1
export PATH="/opt/poetry/bin:$PATH"
poetry new foobar
pushd foobar
poetry lock
poetry install --sync
poetry add pillow
EOF |
Tried again with Ubuntu 20.04: docker run --rm -i --entrypoint /bin/bash ubuntu:20.04 <<EOF
apt-get update
apt-get install -y python3 python3-venv python3-pip curl
curl https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - --version 1.2.1
export PATH="/opt/poetry/bin:$PATH"
poetry new foobar
pushd foobar
poetry lock
poetry install --sync
poetry add pillow
EOF |
I would check you're really on the Poetry version you think you're on -- the |
that this is with ubuntu 20.04 and the system python. If I use a deadsnakes python3.9, then it's not there:
I don't intend to dig further, my money is on it being connected to or the same as that ubuntu bug I linked yesterday |
Interesting -- that does look like Ubuntu is doing some extremely sketchy stuff and it's not Poetry's fault... |
I wondered why poetry didn't also uninstall pip and setuptools in that case, the answer is that there's some special-case code. So if you wanted to treat pkg-resources as a special case to cope with this, I guess that's where to do it. |
Right, but uninstalling that nonsense This really seems like a Ubuntu issue to me, in that case. This would be solved both by #6458 or Poetry using its own installer code (#6205). |
it shouldn't only be about pip and installation though. If a project is using pkg_resources and is in an environment where pkg_resources is provided by this strange debundled version - then uninstalling that package will break the project. |
I was assuming that if the project used |
but you wouldn't declare an explicit dependency on So then poetry would see no reason to keep the unbundled |
That is a fair point -- maybe we just hold our nose and whitelist |
@neersighted that sounds like a good solution, even though I agree that the |
Also, adding |
Poetry 1.2.2 removes setuptools from my project:
And google APIs do not work without
It seems it works but looks very strange. |
This is presumably because setuptools is required by an optional dependency you are not installing, so Poetry considers it a managed package. You do explicitly depend on It's hard to provide more insight without seeing your pyproject.toml -- I suggest asking in Discord or on Discussions if you have more questions. |
I run into this problem for Docker images based on Ubuntu 20.04 LTS as well. I know it's an ugly workaround, but running
after |
In recent versions of Python |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue
When running
poetry install --sync
, poetry removes anything pre-installed (as it should), unfortunately this includespkg-resources
(see #2673 for a discussion), which is pre-installed.Removing this package leads to an error when trying to then
poetry add pillow
, as discussed in #5104.I also tried this with Poetry 1.2.0b2, mentioned in #5104 - same problem.
The text was updated successfully, but these errors were encountered: