Wrong installation directory for python (3.4+) extension

Sandro Santilli strk at kbt.io
Fri Oct 7 09:16:34 UTC 2016


Hi, I'm forwarding you this report of what looks like a bug in
distutils.sysconfig.get_python_lib found in python-3.4 and python-3.5
packages in Ubuntu 16.04, of which you are reported as being the
"Maintainer" and "Original-Maintainer".

Basically get_python_lib(prefix="/usr/local") is returning a directory
which is *not* in the default PYTHONPATH (the one under /usr/local in
the default PYTHONPATH having the minor version included and the one
returned by get_python_lib not having it).

This behavior makes default installs of gdal-python build go in a
non-used python3 directory.

Can you help us understand if this is a package-specific configuration
issue and/or how to deal with it ?

Thanks in advance.

--strk;

----- Forwarded message from GDAL <trac at osgeo.org> -----

Date: Fri, 07 Oct 2016 06:42:27 -0000
From: GDAL <trac at osgeo.org>
Subject: Re: [GDAL] #6671: Wrong installation directory for python (3.4+) extension
X-Mailer: Trac 1.0.5, by Edgewall Software
Reply-To: trac at osgeo.org
In-Reply-To: <043.18c814b9f1b16ca15b41b2bb2a7a5710 at osgeo.org>

#6671: Wrong installation directory for python (3.4+) extension
---------------------+--------------------------
 Reporter:  strk     |       Owner:  warmerdam
     Type:  defect   |      Status:  new
 Priority:  normal   |   Milestone:
Component:  default  |     Version:  unspecified
 Severity:  normal   |  Resolution:
 Keywords:           |
---------------------+--------------------------

Comment (by antonio):

 It seems to be issue relater to the ubuntu/debian customization of the
 python installation.
 I can confirm that if I run


 {{{
 $ env PYTHONPATH=/opt/custompath python3 -c "from __future__ import
 print_function;from distutils.sysconfig import
 get_python_lib;print(get_python_lib(prefix=\"/usr/local\"))"

 /usr/local/lib/python3/dist-packages
 }}}

 I get the path with the minor version omitted on ubuntu 10.06.

 It is not in the system path


 {{{
 env PYTHONPATH="" python3 -c "from __future__ import print_function;import
 sys;print(sys.path)"

 ['',
  '/usr/lib/python35.zip',
  '/usr/lib/python3.5',
  '/usr/lib/python3.5/plat-x86_64-linux-gnu',
  '/usr/lib/python3.5/lib-dynload',
  '~/.local/lib/python3.5/site-packages',
  '/usr/local/lib/python3.5/dist-packages',
  '/usr/lib/python3/dist-packages']
 }}}


 Anyway on the same machine if I use the anaconda installation I get the
 expected standard path:


 {{{
 $ env PYTHONPATH=/opt/ppp ~/anaconda3/bin/python3 -c "from __future__
 import print_function;from distutils.sysconfig import
 get_python_lib;print(get_python_lib(prefix=\"/usr/local\"))"

 /usr/local/lib/python3.5/site-packages
 }}}

 Maybe it good be a good idea to contact debian developers for
 clarifications.

--
Ticket URL: <https://trac.osgeo.org/gdal/ticket/6671#comment:1>
GDAL <http://trac.osgeo.org/gdal/>
Geospatial Data Abstraction Library is a translator library for raster and vector geospatial data formats.

----- End forwarded message -----




More information about the Ubuntu-devel-discuss mailing list