Opened 10 years ago

Last modified 10 years ago

#3297 new defect

building PythonInterface fails

Reported by: Stephen Bosch <posting@…> Owned by: somebody
Priority: normal Milestone: Future
Component: Build Environment Version: trunk
Keywords: Cc:

Description

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.

Change History (1)

comment:1 by Stephen Bosch <posting@…>, 10 years ago

Output of svn info:

Path: .
Working Copy Root Path: /home/sfbosch/src/modelica/openmodelica
URL: https://openmodelica.org/svn/OpenModelica/trunk/PythonInterface
Relative URL: /trunk/PythonInterface
Repository Root: https://openmodelica.org/svn/OpenModelica
Repository UUID: f25d12d1-65f4-0310-ae8a-bbce733d8d8e
Revision: 25730
Node Kind: directory
Schedule: normal
Last Changed Author: adeas31
Last Changed Rev: 21032
Last Changed Date: 2014-06-10 15:26:59 +0200 (Tue, 10 Jun 2014)

Note: See TracTickets for help on using tickets.