3 回答
TA贡献1802条经验 获得超5个赞
WSL 与该问题无关,这是一个相当标准的错误。
确保安装了以下软件包。使用apt-get install packagename. 此特定时间的问题已通过安装python-dev.
python3
python3-pip
ipython3
build-essential
python-dev
python3-dev
作为单个命令:
sudo apt-get install python3 python3-pip ipython3 build-essential python-dev python3-dev
TA贡献1872条经验 获得超3个赞
我在 Ubuntu 上运行 Python 3.5。我是如何安装regexPython 包的:
$ sudo apt-get install libpython3.5-dev
$ pip3 install regex --no-use-wheel
背景研究详情:
我Python.h通过使用apt-file来定位它来确定提供丢失文件的包名称。
# install the apt-file package in case you don't have it
$ sudo apt-get install apt-file
# populate/refresh the local apt-file package data
$ sudo apt-file update
# search for /Python.h. Since it's a C header file,
# I also grep for /include to limit the results.
$ sudo apt-file search /Python.h | grep /include
libpython2.7-dbg: /usr/include/python2.7_d/Python.h
libpython2.7-dev: /usr/include/python2.7/Python.h
libpython3.5-dbg: /usr/include/python3.5dm/Python.h
libpython3.5-dev: /usr/include/python3.5m/Python.h
pypy-dev: /usr/lib/pypy/include/Python.h
然后对我需要哪个包进行了有根据的猜测。忽略Python2,忽略调试(dbg),忽略pypy,从而留下libpython3.5-dev。
添加回答
举报