python3 distutils reports path which is not in sys.path for /usr/local prefix

Bug #1847510 reported by Tobias Faller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3-defaults (Ubuntu)
New
Undecided
Unassigned

Bug Description

sysconfig.distutils.get_python_lib() reports the path '/usr/local/lib/python3/dist-packages' for the prefix '/usr/local'.
This does not match the path '/usr/local/lib/python3.6/dist-packages' which is listed in sys.path.

Command: python3 -c "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix='/usr/local'))"
Output: /usr/local/lib/python3/dist-packages

Command: python3 -c "import sys; print(sys.path)"
Output: ['', '/usr/local/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/administrator/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']

Ubuntu release version: Ubuntu 18.04.3 LTS
python3-distutils version: 3.6.8~18.04

If this is a bug then this could be fixed by patching distutils/sysconfig.py in some way. (attached)

Tags: python3
Revision history for this message
Tobias Faller (tobiplusplus) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.