You are not logged in.

#1 2011-10-18 00:35:34

mikemrh9
Member
Registered: 2009-02-17
Posts: 16

CMake error: PYTHON_LIBRARY-NOTFOUND while compiling QGIS [Solved]

Hi.

I'm trying to install QGIS 1.7.0-4 from the AUR onto an x86_64 system. All of the dependencies listed with the package at https://aur.archlinux.org/packages.php?ID=50913 have been successfully installed (including qwt5 fro the AUR).

I installed QGIS onto a 32-bit system a few weeks ago using the same method and it worked flawlessly. However, on my x86_64 system when I run 'makepkg -s' it fails with the following error:

-- Found PythonInterp: /usr/bin/python (found version "3.2.2")
-- Found Python executable: /usr/bin/python
-- Found Python version: 3.2.2
-- Found Python library: PYTHON_LIBRARY-NOTFOUND
-- Found SIP version: 4.12.4
-- Found PyQt4 version: 4.8.5
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PYTHON_LIBRARY
    linked by target "python_module_qgis_analysis" in directory /home/mike/progdata/AUR/qgis/src/qgis-1.7.0/python
    linked by target "python_module_qgis_core" in directory /home/mike/progdata/AUR/qgis/src/qgis-1.7.0/python
    linked by target "python_module_qgis_gui" in directory /home/mike/progdata/AUR/qgis/src/qgis-1.7.0/python
    linked by target "qgispython" in directory /home/mike/progdata/AUR/qgis/src/qgis-1.7.0/src/python
    linked by target "pyspatialite" in directory /home/mike/progdata/AUR/qgis/src/qgis-1.7.0/python/pyspatialite

-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().
    Aborting...

I have looked through the src folder for the QGIS package and have found a file called FindPythonLibrary.cmake which I don't really understand, but looks as though it should find the python libraries and set the PYTHON_LIBRARY variable.

I have the following python packages installed on my system: pyqt, python, python2, python2-pyqt (the last of which was installed when I asked pacman to install python2-qt).

I have the following libraries, one of which I assume is the one that I should be trying to use?

/usr/lib/libpython2.7.so
/usr/lib/libpython3.so

If anybody could help me with this or let me know if I'm on the right track, that would be much appreciated...

Last edited by mikemrh9 (2011-10-28 20:40:03)

Offline

#2 2011-10-18 14:33:50

Secagy
Member
From: Germany
Registered: 2007-10-07
Posts: 11

Re: CMake error: PYTHON_LIBRARY-NOTFOUND while compiling QGIS [Solved]

Hi,

I had the same problem today, but got it working now. All you have to do is to add an additional parameter to cmake in the pkgbuild so that it points to python2.

-DPYTHON_LIBRARY=/usr/bin/python2

After that change the build failed at about 50% due to some error with qwt. It worked after I removed qwt (version 6, which is in extra), so that only qwt5 (from aur) remains on the system.


I hope you get it working with this info, good luck.

Offline

#3 2011-10-18 22:02:08

mikemrh9
Member
Registered: 2009-02-17
Posts: 16

Re: CMake error: PYTHON_LIBRARY-NOTFOUND while compiling QGIS [Solved]

Thanks for the help - I followed your advice and the PYTHON_LIBRARY error vanished. Great! I don't have qwt version 6 installed, so that wasn't an issue for me. However, I came up against another python-related error at at 63%:

http://pastebin.com/ZSqEEspR

The section of code in utils.py  which contains the apparent syntax error (except Exception, e:) is as follows:

def unloadPlugin(packageName):
  """ unload and delete plugin! """
  global plugins, active_plugins

  if not plugins.has_key(packageName): return False
  if packageName not in active_plugins: return False

  try:
    plugins[packageName].unload()
    del plugins[packageName]
    active_plugins.remove(packageName)
    _unloadPluginModules(packageName)
    return True
  except Exception, e:
    msg = QCoreApplication.translate("Python", "Error while unloading plugin %1").arg(packageName)
    showException(sys.exc_type, sys.exc_value, sys.exc_traceback, msg)
    return False

I don't know where this code was originally generated, and am pretty sure that it will be re-created in it's current form next time I compile the program? Maybe it needs to run against a different version of python to the one I have (version 2.7)? I've tried running it against version 3.2 (by changing -DPYTHON_LIBRARY=/usr/bin/python2 to  -DPYTHON_LIBRARY=/usr/bin/python in the PKGBUILD), but got the same error at the same point. If you have a few minutes to spare to look over this one, I would be most grateful to hear your thoughts.

Last edited by mikemrh9 (2011-10-18 23:15:52)

Offline

#4 2011-10-28 20:39:24

mikemrh9
Member
Registered: 2009-02-17
Posts: 16

Re: CMake error: PYTHON_LIBRARY-NOTFOUND while compiling QGIS [Solved]

Got this working - see the thread at https://aur.archlinux.org/packages.php?ID=50913

Offline

Board footer

Powered by FluxBB