You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
Issue
I have become quite used to seeing messages like these when running poetry install, and I am curious if other people experience the problem I will describe.
Project environment contains an invalid distribution (...myenvpath.../lib/python3.10/site-packages/protobuf-3.19.5.dist-info). Consider removing it manually or recreate the environment.
Project environment contains an invalid distribution (...myenvpath.../lib/python3.10/site-packages/typing_extensions-4.3.0.dist-info). Consider removing it manually or recreate the environment.
Installing dependencies from lock file
I usually go to the site-packages directory and manually remove the duplicate *.dist-info directories as suggested. I noticed that all these "leftover" dist-info directories share a common feature. They only contain one file, REQUESTED. I searched issues for something similar, the closest I found was #2918, but I found nothing mentioning this REQUESTED file.
site-packages$ ls protobuf-3.19.*.dist-info
protobuf-3.19.5.dist-info:
REQUESTED
protobuf-3.19.6.dist-info:
INSTALLER METADATA namespace_packages.txt RECORD REQUESTED top_level.txt WHEEL
site-packages$ ls typing_extensions*.dist-info
typing_extensions-4.3.0.dist-info:
REQUESTED
typing_extensions-4.4.0.dist-info:
INSTALLER LICENSE METADATA RECORD REQUESTED WHEEL
The version numbers suggest this old file is not being cleaned up when the rest of the old dist-info directory is removed when poetry installs a newer version of the package with one of its operations. Unfortunately I don't have a good sense if it only occurs from poetry install (the command I run most often, usually after poetry lock --no-update), or if it can occur from other poetry commands. The REQUESTED files are empty. Apparently this file existing means the package "was installed by user request", based on the following from ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/distlib/database.py line 336.
requested = False
"""A boolean that indicates whether the ``REQUESTED`` metadata file is
present (in other words, whether the package was installed by user
request or it was installed as a dependency)."""
This didn't make sense to me at first, because neither protobuf nor typing-extensions are directly specified in my pyproject.toml (sorry, I did not include a link to my pyproject.toml because I do not know how to "sanitize" it).
$ poetry show --why --tree typing-extensions
tensorflow 2.9.2 TensorFlow is an open source machine learning framework for everyone.
└── typing-extensions >=3.6.6
$ poetry show --why --tree protobuf
google-api-core 2.10.2 Google API client core library
└── protobuf >=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev
googleapis-common-protos 1.56.4 Common protobufs used in Google APIs
└── protobuf >=3.15.0,<5.0.0dev
tensorboard 2.9.1 TensorBoard lets you watch Tensors Flow
└── protobuf >=3.9.2,<3.20
tensorflow 2.9.2 TensorFlow is an open source machine learning framework for everyone.
└── protobuf >=3.9.2,<3.20
But it essentially appears every package poetry installs is considered "installed by user request" (there are a couple remaining discrepancies, why the numbers don't match)
If other people experience this same issue, hopefully this is enough to point someone curious in the right direction. I found this problem was difficult to reliably reproduce, but it has happened pretty frequently since I began using poetry around a month ago.
The text was updated successfully, but these errors were encountered:
I've experienced leftover *.dist-info folders from time to time, too. I have to admit it happens too rarely for me to have bothered to check which files are left before removing the folder.
I assume the REQUESTED file is created by pip for each package that is installed explicitly and not as a dependency of another package. Since we install each of the locked packages explicitly, this file should be created for all of them. One exception is the root package itself. Maybe, there are more exceptions.
Poetry version: Version: 1.2.2
Python version: Python: 3.10.6
OS version and name: Ubuntu 22.04
I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
Issue
I have become quite used to seeing messages like these when running
poetry install
, and I am curious if other people experience the problem I will describe.I usually go to the site-packages directory and manually remove the duplicate
*.dist-info
directories as suggested. I noticed that all these "leftover" dist-info directories share a common feature. They only contain one file,REQUESTED
. I searched issues for something similar, the closest I found was #2918, but I found nothing mentioning thisREQUESTED
file.The version numbers suggest this old file is not being cleaned up when the rest of the old dist-info directory is removed when poetry installs a newer version of the package with one of its operations. Unfortunately I don't have a good sense if it only occurs from
poetry install
(the command I run most often, usually afterpoetry lock --no-update
), or if it can occur from other poetry commands. TheREQUESTED
files are empty. Apparently this file existing means the package "was installed by user request", based on the following from~/.local/share/pypoetry/venv/lib/python3.10/site-packages/distlib/database.py
line 336.This didn't make sense to me at first, because neither
protobuf
nortyping-extensions
are directly specified in my pyproject.toml (sorry, I did not include a link to my pyproject.toml because I do not know how to "sanitize" it).But it essentially appears every package poetry installs is considered "installed by user request" (there are a couple remaining discrepancies, why the numbers don't match)
If other people experience this same issue, hopefully this is enough to point someone curious in the right direction. I found this problem was difficult to reliably reproduce, but it has happened pretty frequently since I began using poetry around a month ago.
The text was updated successfully, but these errors were encountered: