gatagat/lap

Installing problem

Closed this issue · 10 comments

Hi I am having trouble installing lap using pip or from source.
the pre-requirements are met.

The error information is as below

Collecting lap
Using cached lap-0.4.0.tar.gz (1.5 MB)
Building wheels for collected packages: lap
Building wheel for lap (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/chengzhi/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-evg25__1/lap/setup.py'"'"'; file='"'"'/tmp/pip-install-evg25__1/lap/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/pip-wheel-pr1ft8os
cwd: /tmp/pip-install-evg25__1/lap/
Complete output (34 lines):
Partial import of lap during the build process.
Generating cython files
running bdist_wheel
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "lap._lapjv" sources
building data_files sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.7/lap
copying lap/init.py -> build/lib.linux-x86_64-3.7/lap
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'lap._lapjv' extension
compiling C++ sources
C compiler: g++ -pthread -B /home/chengzhi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

creating build/temp.linux-x86_64-3.7/lap
compile options: '-I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ilap -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/chengzhi/anaconda3/include/python3.7m -c'
g++: lap/_lapjv.cppg++: lap/lapjv.cpp
g++: lap/lapmod.cpp

error: Command "g++ -pthread -B /home/chengzhi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ilap -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/chengzhi/anaconda3/include/python3.7m -c lap/lapjv.cpp -o build/temp.linux-x86_64-3.7/lap/lapjv.o -MMD -MF build/temp.linux-x86_64-3.7/lap/lapjv.o.d" failed with exit status 127

ERROR: Failed building wheel for lap
Running setup.py clean for lap
Failed to build lap
Installing collected packages: lap
Running setup.py install for lap ... error
ERROR: Command errored out with exit status 1:
command: /home/chengzhi/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-evg25__1/lap/setup.py'"'"'; file='"'"'/tmp/pip-install-evg25__1/lap/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-record-g_0rafgk/install-record.txt --single-version-externally-managed --compile --install-headers /home/chengzhi/anaconda3/include/python3.7m/lap
cwd: /tmp/pip-install-evg25__1/lap/
Complete output (34 lines):
Partial import of lap during the build process.
Generating cython files
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "lap._lapjv" sources
building data_files sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.7/lap
copying lap/init.py -> build/lib.linux-x86_64-3.7/lap
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'lap._lapjv' extension
compiling C++ sources
C compiler: g++ -pthread -B /home/chengzhi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

creating build/temp.linux-x86_64-3.7/lap
compile options: '-I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ilap -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/chengzhi/anaconda3/include/python3.7m -c'
g++: lap/_lapjv.cppg++: lap/lapjv.cpp
g++: lap/lapmod.cpp

error: Command "g++ -pthread -B /home/chengzhi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ilap -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/chengzhi/anaconda3/include/python3.7m -c lap/lapmod.cpp -o build/temp.linux-x86_64-3.7/lap/lapmod.o -MMD -MF build/temp.linux-x86_64-3.7/lap/lapmod.o.d" failed with exit status 127
----------------------------------------

ERROR: Command errored out with exit status 1: /home/chengzhi/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-evg25__1/lap/setup.py'"'"'; file='"'"'/tmp/pip-install-evg25__1/lap/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-record-g_0rafgk/install-record.txt --single-version-externally-managed --compile --install-headers /home/chengzhi/anaconda3/include/python3.7m/lap Check the logs for full command output.

When Installing from source, the error information is

Partial import of lap during the build process.
Generating cython files
/home/chengzhi/anaconda3/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/chengzhi/Games/MOT_GAME/FairMOT/lap-master/lap/_lapjv.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "lap._lapjv" sources
building data_files sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/lap
copying lap/init.py -> build/lib.linux-x86_64-3.7/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.7/lap
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'lap._lapjv' extension
compiling C++ sources
C compiler: g++ -pthread -B /home/chengzhi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

creating build/temp.linux-x86_64-3.7/lap
compile options: '-I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ilap -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/chengzhi/anaconda3/include/python3.7m -c'
g++: lap/_lapjv.cpp
g++: lap/lapjv.cpp
g++: lap/lapmod.cpp
error: Command "g++ -pthread -B /home/chengzhi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ilap -I/home/chengzhi/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/chengzhi/anaconda3/include/python3.7m -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.7/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.7/lap/_lapjv.o.d" failed with exit status 127

您好,请问这个问题解决了嘛?Have you solved the problem?Thanks!!!

Hello, have you solved it? I met with similar problems :(

@vickyliuliu you can try this in conda environment: conda install -c conda-forge lap

Also would like to know if this is resolved. I'm am getting the same issue on RHEL 7.8.

@mphillips-valleyit Can you run g++ --version and paste it here?

@gatagat Thanks for responding. Actually I didn't have g++ installed! (Just gcc.) After installing that, pip install lap works although pip install lapsolver does not--but that's a separate issue I guess.

@mphillips-valleyit Glad it worked and thanks for reporting back. And yes, this repo has nothing to do with lapsolver.

@vickyliuliu you can try this in conda environment: conda install -c conda-forge lap

very helpfull thanks alot!

@gatagat following your procedures had it solved
-sudo apt install g++
-pip install lap