用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
在这里插入图片描述

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐