ethereon / lycon

A minimal and fast image library for Python and C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install for python3 on Ubuntu 16.04 (error with `PYTHON_LIB_PATH`)

jiho opened this issue · comments

Hi,

On an up to date 16.04 system, I get

$ sudo -H pip3 install lycon
Collecting lycon
  Using cached lycon-0.1.9.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages (from lycon)
Building wheels for collected packages: lycon
  Running setup.py bdist_wheel for lycon ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ir_6h7y2/lycon/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpr8js3gg7pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/lycon
  copying lycon/__init__.py -> build/lib.linux-x86_64-3.5/lycon
  copying lycon/enum.py -> build/lib.linux-x86_64-3.5/lycon
  copying lycon/core.py -> build/lib.linux-x86_64-3.5/lycon
  running egg_info
  writing lycon.egg-info/PKG-INFO
  writing requirements to lycon.egg-info/requires.txt
  writing dependency_links to lycon.egg-info/dependency_links.txt
  writing top-level names to lycon.egg-info/top_level.txt
  warning: manifest_maker: standard file '-c' not found
  
  reading manifest file 'lycon.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'lycon.egg-info/SOURCES.txt'
  running build_ext
  Source path is /tmp/pip-build-ir_6h7y2/lycon
  -- The C compiler identification is GNU 5.4.0
  -- The CXX compiler identification is GNU 5.4.0
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
  -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.2.54")
  -- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so
  -- Python binary: /usr/bin/python3
  -- Python include path: /usr/include/python3.5m
  -- Python library path: /usr/lib
  -- Python version: 3.5
  -- Expanding search for libpython
  -- Python library path: PYTHON_LIB_PATH-NOTFOUND
  -- NumPy include path: /usr/local/lib/python3.5/dist-packages/numpy/core/include
  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_LIB_PATH
      linked by target "pycon" in directory /tmp/pip-build-ir_6h7y2/lycon
  
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-build-ir_6h7y2/lycon/build/temp.linux-x86_64-3.5/CMakeFiles/CMakeOutput.log".
  	* Failed to build the Lycon native extension.
  	* [Error] Failed to exceute: /usr/bin/cmake /tmp/pip-build-ir_6h7y2/lycon -DPYTHON_BIN=/usr/bin/python3
  
  ----------------------------------------
  Failed building wheel for lycon
  Running setup.py clean for lycon
Failed to build lycon
Installing collected packages: lycon
  Running setup.py install for lycon ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ir_6h7y2/lycon/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-g6h2go1a-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/lycon
    copying lycon/__init__.py -> build/lib.linux-x86_64-3.5/lycon
    copying lycon/enum.py -> build/lib.linux-x86_64-3.5/lycon
    copying lycon/core.py -> build/lib.linux-x86_64-3.5/lycon
    running egg_info
    writing top-level names to lycon.egg-info/top_level.txt
    writing dependency_links to lycon.egg-info/dependency_links.txt
    writing lycon.egg-info/PKG-INFO
    writing requirements to lycon.egg-info/requires.txt
    warning: manifest_maker: standard file '-c' not found
    
    reading manifest file 'lycon.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'lycon.egg-info/SOURCES.txt'
    running build_ext
    Source path is /tmp/pip-build-ir_6h7y2/lycon
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
    -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.2.54")
    -- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so
    -- Python binary: /usr/bin/python3
    -- Python include path: /usr/include/python3.5m
    -- Python library path: /usr/lib
    -- Python version: 3.5
    -- Expanding search for libpython
    -- Python library path: PYTHON_LIB_PATH-NOTFOUND
    -- NumPy include path: /usr/local/lib/python3.5/dist-packages/numpy/core/include
    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_LIB_PATH
        linked by target "pycon" in directory /tmp/pip-build-ir_6h7y2/lycon
    
    -- Configuring incomplete, errors occurred!
    See also "/tmp/pip-build-ir_6h7y2/lycon/build/temp.linux-x86_64-3.5/CMakeFiles/CMakeOutput.log".
    	* Failed to build the Lycon native extension.
    	* [Error] Failed to exceute: /usr/bin/cmake /tmp/pip-build-ir_6h7y2/lycon -DPYTHON_BIN=/usr/bin/python3
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ir_6h7y2/lycon/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-g6h2go1a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 255 in /tmp/pip-build-ir_6h7y2/lycon/

Even tough I tried exporting PYTHON_LIB_PATH to something meaningful

$ echo $PYTHON_LIB_PATH
/usr/lib/python3/dist-packages/

I "just" needed to install libpython-dev. Silly of me.

sudo apt-get install cmake build-essential libjpeg-dev libpng-dev