缺少 Python.h 且无法找到 [英] Missing Python.h and impossible to find
问题描述
我知道已经有关于缺少的 Python.h 的类似问题,但目前没有解决方案对我有用.
I know there are already similar questions about the missing Python.h but NO solution worked for me by now.
我需要 Python 库才能使用 Tossim,这是一个 tinyOS 模拟器 (http://tinyos.net).
I need Python libraries in order to use Tossim, which is a tinyOS simulator (http://tinyos.net).
Python 似乎已经安装在我的 Ubuntu 12.04 系统上.事实上,每当我运行命令
Python appears to be already installed on my Ubuntu 12.04 system. In fact whenever I run the command
$ python -V
我得到输出 2.7.3
无论如何,当我尝试定位 Python.h 时,没有找到任何文件.Python 库位于 usr/lib/中,但文件夹中没有标题.
Anyway when I try to locate Python.h no file is found. Python libraries are located in usr/lib/ but no headers in the folder.
请注意,我已经尝试了针对此问题的最常见解决方案,即 $ sudo apt-get install python-dev
和 $ sudo apt-获取更新
.他们都没有为我工作.
Mind that I already tried the most common solution for this problem, that is $ sudo apt-get install python-dev
, and also $ sudo apt-get update
.
None of them worked for me.
我现在该怎么办?我试图删除并重新安装 python-dev,但没有成功.我只想手动下载并将标题放入文件夹 usr/lib/python2.7 中.但我怀疑这是个好主意.有人可以帮助我吗?提前谢谢你.`
What should I do now? I tried to remove and reinstall python-dev, with no success. I only think to manually download and place the header into the folder usr/lib/python2.7. But I doubt it is a good idea. Can somebody help me? Thank you in advance.`
推荐答案
Ubuntu(和 Debian)将 Python 包含文件存储在 /usr/include/python2.7
中.如果安装了 python2.7-dev
包(python-dev
的依赖项),则 Python.h
将位于:>
Ubuntu (and Debian) stores Python include files in /usr/include/python2.7
. If the python2.7-dev
package is installed (a dependency of python-dev
) then Python.h
will be located at:
/usr/include/python2.7/Python.h
您可以使用以下命令找到包含该文件的包:
You can locate what packages contain the file with the command:
dpkg -S Python.h
或列出随包一起安装的文件:
or list what files are installed with a package with:
dpkg -L python2.7-dev
这篇关于缺少 Python.h 且无法找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!