linux下,pip安装lap出现问题 ,已解决,亲测有效

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

  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kjoo0n5h/lap_0fdf00f39639412081865616dc35696f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kjoo0n5h/lap_0fdf00f39639412081865616dc35696f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-fp9ptui3
       cwd: /tmp/pip-install-kjoo0n5h/lap_0fdf00f39639412081865616dc35696f/
  Complete output (22 lines):
  Partial import of lap during the build process.
  Generating cython files
  running bdist_wheel
  running build
  running config_cc
  running config_fc
  running build_src
  /usr/local/lib/python3.8/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    warnings.warn(
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/lap
  copying lap/lapmod.py -> build/lib.linux-x86_64-3.8/lap
  copying lap/__init__.py -> build/lib.linux-x86_64-3.8/lap
  running build_ext
  creating build/temp.linux-x86_64-3.8/lap
  lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: Command "x86_64-linux-gnu-g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python3.8/dist-packages/numpy/core/include -Ilap -I/usr/local/lib/python3.8/dist-packages/numpy/core/include -I/usr/include/python3.8 -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.8/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.8/lap/_lapjv.o.d" failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for lap

解决方法

try this:
sudo apt install libpython3.8-dev

python 版本根据自己而定
再次安装就是success
在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值