linux下,pip安装lap出现问题,conda安装不在源内,已解决,有效

用pip安装出现报错,并且这个包网上查了很多都没办法解决,于是来记录一下我的解决方法。

  note: This error originates from a subprocess, and is likely not a problem with pip.
  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: subprocess-exited-with-error
  
  × Running setup.py install for lap did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      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/__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 /root/anaconda3/envs/paddle/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
      
      creating build/temp.linux-x86_64-3.7/lap
      compile options: '-I/root/anaconda3/envs/paddle/lib/python3.7/site-packages/numpy/core/include -Ilap -I/root/anaconda3/envs/paddle/lib/python3.7/site-packages/numpy/core/include -I/root/anaconda3/envs/paddle/include/python3.7m -c'
      g++: lap/_lapjv.cppg++: lap/lapjv.cppg++: lap/lapmod.cpp
      
      
      error: Command "g++ -pthread -B /root/anaconda3/envs/paddle/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/root/anaconda3/envs/paddle/lib/python3.7/site-packages/numpy/core/include -Ilap -I/root/anaconda3/envs/paddle/lib/python3.7/site-packages/numpy/core/include -I/root/anaconda3/envs/paddle/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
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> lap

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

conda安装出现不在源内,报错

C:\Users\Dell>conda install lap
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - lap

Current channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

解决方法一:

用conda安装,用以下命令:

conda install -c conda-forge lap

解决方法二:

用pip安装,用以下命令:

pip install git+git://github.com/gatagat/lap.git

这个我没试过,因为第一种就成功了。

猜你喜欢

转载自blog.csdn.net/qq_52908337/article/details/123282347