#6671 closed defect (fixed)
Wrong installation directory for python (3.4+) extension
Reported by: | strk | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | antonio, Mike Taves |
Description
The default build, with python-3.5, installs the extension in a wrong directory, that is a directory not contained in the default PYTHONPATH.
I found this being due to the way swig/python/GNUmakefile tries to determine the destination directory, which is via:
get_python_lib(prefix='/usr/local')
Which starting from python-3.4 seems to give an answer which is _not_ in the default PYTHONPATH (basically omits the minor version from the python directory name).
I confirm that using
python setup.py install --prefix=/usr/local
would do the right thing, both for /usr/local prefix and for other custom prefixes (on Ubuntu 16.04).
But the GNUmakefile is tweaking the PYTHONPATH prior to the setup.py call so to make the bogus destination path appear first, and I guess the --prefix switch to setup.py call simply picks the first path with the given prefix in PYTHONPATH, if present.
The use of the now-bogus get_python_lib was introduced in r30564 to fix #4563 -- I'd ask mwtoews to please test the bug he reported initially with a cleaned up GNUmakefile, and Antonio too, if possible.
It seems to be issue relater to the ubuntu/debian customization of the python installation. I can confirm that if I run
I get the path with the minor version omitted on ubuntu 10.06.
It is not in the system path
Anyway on the same machine if I use the anaconda installation I get the expected standard path:
Maybe it good be a good idea to contact debian developers for clarifications.