﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3297	building PythonInterface fails	Stephen Bosch <posting@…>	somebody	"On a 64-bit Linux system with python2.7 installed:


{{{
# uname -orvip && python -V
3.18.11-gentoo #1 SMP Mon Apr 20 11:28:44 CEST 2015 Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz GenuineIntel GNU/Linux
Python 2.7.9
}}}

when configured with --enable-python-interface, compilation fails building PythonInterface:

{{{
$ make
# create directories
mkdir -p ..//build/lib/python/omniORB
mkdir -p ..//build/share/omc/scripts/PythonInterface/OMPython/OMParser
omniidl -bpython -Wbglobal=_OMCIDL -Wbpackage=OMPythonIDL ..//Compiler/runtime/omc_communication.idl
! which python2.6 || python2.6 setup.py install --no-compile `test -d /etc/apt && echo --install-layout=deb` --prefix=..//build
which: no python2.6 in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4:/usr/lib64/subversion/bin:/usr/games/bin:/usr/share/omniORB/bin/scripts)
! which python2.7 || python2.7 setup.py install --no-compile `test -d /etc/apt && echo --install-layout=deb` --prefix=..//build
/usr/bin/python2.7
running install
Checking .pth file support in ..//build/lib64/python2.7/site-packages/
/usr/bin/python2.7 -E -c pass
TEST FAILED: ..//build/lib64/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read "".pth"" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    ..//build/lib64/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    './/build/lib64/python2.7/site-packages/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support "".pth"" files by
  using one of the approaches described here:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.
Makefile:6: recipe for target 'install' failed
make: *** [install] Error 1
}}}

Although this example shows what happens when running 'make' from the PythonInterface directory, the result is the same when building everything, and does not depend on whether the user is privileged or unprivileged. In this case, the PYTHONPATH variable was set artificially in an attempt to resolve the problem, it is normally empty. The directory
{{{
..//build/lib64/python2.7/site-packages/
}}}
exists but is empty. 

The build should also work in a jail which wouldn't contain any files (this is for source-based package managers such as Gentoo portage), so the test for .pth files might be problematic."	defect	new	normal	Future	Build Environment	trunk			
