Debian/Ubuntu Python bug leads to python3 installation to incorrect site-packages folder
Install DOLFIN using python3
with --prefix=/usr/local
on Ubuntu 16.04 (and probably more recent Debian as well) leads to the DOLFIN Python module being installed to /usr/local/lib/python3/dist-packages
.
Notice the lack of .5
. This path is not even in the python3
interpreters default path for searching for modules.
The CMakeLists.txt sets this path using the following (correct!) code which you can run in the interpreter directly:
import distutils.sysconfig
print distutils.sysconfig.get_python_lib(plat_specific=True, prefix='/usr/local')
Change to any other prefix except /usr/local
and you get the correct python3.5
folder.
Other projects are having issues too e.g. https://trac.osgeo.org/gdal/ticket/6671 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838323.
Comments (9)
-
reporter -
- edited description
-
reporter I've taken a look at the code for
distutils.sysconfig.get_python_lib
and the/usr/local/lib/python3/dist-packages
is definitely as the developers intended it. The mistake then is that that path is not insys.path
which is more of a Debian/Ubuntu packaging issue. -
reporter -
Is this really a blocker for the release of 2016.2? Looks like a bug in Debian. Isn't it enough that we are aware of this bug and know how to work around it? (I assume by setting
PYTHONPATH
.) -
Setting
PYTHONPATH
screws up side-by-side py2/3 installations. -
reporter - changed status to wontfix
I agree @logg, its an upstream issue. I have a workaround for this involving
*.pth
files that doesn't break py2/py3 installs that I will write up in here. -
Would this be an issue if we used
setuptools
to install the DOLFIN Python module? I presume then that the process would be self-consistent? -
reporter I think so, given the comment on using
setup.py --prefix=/usr/local
successfully in: - Log in to comment
One liner: