sysconfig.get_path('purelib') points to site-packages directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3-defaults (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
python3.5 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
purelib and platlib paths in Python 3 sysconfig module point to site-packages directory:
$ python3 -m sysconfig
Platform: "linux-x86_64"
Python version: "3.4"
Current installation scheme: "posix_prefix"
Paths:
data = "/usr"
include = "/usr/include/
platinclude = "/usr/include/
platlib = "/usr/lib/
platstdlib = "/usr/lib/
purelib = "/usr/lib/
scripts = "/usr/bin"
stdlib = "/usr/lib/
...
whereas Python 2 points to dist-packages:
Platform: "linux-x86_64"
Python version: "2.7"
Current installation scheme: "posix_local"
Paths:
data = "/usr/local"
include = "/usr/local/
platinclude = "/usr/local/
platlib = "/usr/local/
platstdlib = "/usr/lib/
purelib = "/usr/local/
scripts = "/usr/local/bin"
stdlib = "/usr/lib/
...
One severe consequence of this is that automake is installing Python modules to a location which is not in sys.path, namely site-packages directory.
When one uses automake to create a Makefile that installs a Python module to the system, it is installed into /usr/local/
From /usr/share/
AC_CACHE_
[am_
[if test "x$prefix" = xNONE
then
else
fi
am_
$am_python_
if can_use_sysconfig:
sitedir = sysconfig.
else:
from distutils import sysconfig
...
Here, it can be seen that automake uses purelib path defined by the sysconfig module of Python. However, since this path is not included in sys.path, and thus the installed package cannot be used:
$ python3 -c "import sys; print(sys.path)"
['', '/usr/lib/
Ubuntu version:14.10
$ apt-cache policy python3-minimal
python3-minimal:
Installed: 3.4.2-1
Candidate: 3.4.2-1
Version table:
*** 3.4.2-1 0
500 http://
100 /var/lib/
summary: |
- sysconfig paths point to site-packages directory + sysconfig.get_path('purelib') points to site-packages directory |
Status changed to 'Confirmed' because the bug affects multiple users.