pip安装bitarray

jli*_*lim 5 python pip

运行pip install bitarray导致我的致命错误:

bitarray/_bitarray.c:9:20: fatal error: Python.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我正在运行Ubuntu 12.04升级.也许我错过了安装一些依赖项?

运行Python工作:

Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
[GCC 4.6.3] on linux2
Run Code Online (Sandbox Code Playgroud)

Mar*_*eth 16

至少,你需要python-dev包

sudo apt-get install python-dev

  • 在RedHat系统上,这个包叫做python-devel. (2认同)