-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] python setup.py develop/install installs package in site-packages, but only dist-packages is on path #3924
Comments
Hi @shughes-uk , isn't What is the output of Please also try to avoid using |
Here's the output of things. I too thought docker run -it ubuntu:20.04
apt-get update -y && apt-get install -y python3 python3-pip
python3 -m site
--- output ----
sys.path = [
'/',
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload',
'/usr/local/lib/python3.8/dist-packages',
'/usr/lib/python3/dist-packages',
]
USER_BASE: '/root/.local' (doesn't exist)
USER_SITE: '/root/.local/lib/python3.8/site-packages' (doesn't exist)
ENABLE_USER_SITE: True
pip3 install backoff
python3 -c "import backoff; print(backoff.__file__)"
---- output ----
/usr/local/lib/python3.8/dist-packages/backoff/__init__.py I understand We can probably work around that by pinning to an older setuptools in our testing. Things are deprecated but nothing so far claims it wont work entirely , especially on something as common at ubuntu 20.04 system python. So this was fairly surprising and would have been quite painful to debug if I wasn't very experienced with the technical details of python environments. |
Probably what is happening here is that prior to Python 3.10, debian-systems patch the However A new mechanism was devised in So there are a few ways of dealing with this:
For more information, there are quite a few issues in pypa/setuptools and pypa/distutils discussing the approach, but I think this post summarises the overall reasoning: #2956 (comment). |
setuptools version
67.6.1
Python version
Python 3.8
OS
Ubuntu 20:04
Additional environment information
Using python 3.8 installed via apt-get.
Description
Installing a package via
python setup.py develop/install
on ubuntu:20.04, results in the package being installed to the wrong place,site-packages
instead ofdist-packages
I've confirmed previous versions of setuptools correctly install things to
dist-packages
(45.2.0
)Expected behavior
Running
python setup.py install
makes the package importableHow to Reproduce
python setup.py install
with the system python onubuntu:20.04
Output
The text was updated successfully, but these errors were encountered: