[Bug 1940705] Re: distutils and sysconfig returns unexpected paths
Stefano Rivera
1940705 at bugs.launchpad.net
Sat Mar 12 03:32:23 UTC 2022
Fixed in 3.10.2-3.
** Changed in: python3.10 (Ubuntu)
Status: Confirmed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3.10 in Ubuntu.
https://bugs.launchpad.net/bugs/1940705
Title:
distutils and sysconfig returns unexpected paths
Status in python3.10 package in Ubuntu:
Fix Released
Bug description:
Debian and Ubuntu’s Python 3.9 (and prior) patches distutils so pip
installs things to /usr/local/lib/python3.Y/dist-packages, but 3.10
does not do the same:
$ python3.10
Python 3.10.0b1 (default, May 11 2021, 08:45:09) [GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.command.install import install
<stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
>>> from distutils.dist import Distribution
>>> c = install(Distribution())
>>> c.finalize_options()
>>> c.install_platlib
'/usr/lib/python3.10/dist-packages'
Furthermore, pip is planning to switch to sysconfig for fetching the
path soon (could happen before Ubuntu 21.10), and 3.10’s sysconfig is
currently returning a different, but still unexpected path:
>>> import sysconfig
>>> sysconfig.get_path('platlib')
'/usr/lib/python3.10/site-packages'
Neither path would break the system (apt puts packages under
/usr/lib/python3/dist-packages), but my understanding is pip
installing things into /usr/lib is still not ideal. So both of those
need to be fixed, and they need to point to the same location (also
purelib, headers/include, scripts, and data).
----
Some context to this: The python3.10 package is backported to earlier
Ubuntu versions by deadsnakes, which does not ship python3.10-pip, so
people are installing the upstream pip directly. And when they do
this, /usr/bin/pip gets overwritten unexpectedly.
deadsnakes: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/1940705/+subscriptions
More information about the foundations-bugs
mailing list