我有一个小问题(或一个大问题?)。我想为 Python 3.4 安装正则表达式包。但是后来我使用 pip 或我们的安装方法出现错误:
Universe@universe-AOD270:~/Downloads/regex-2016.04.25$ python setup.py 安装 --user 运行安装 运行构建 运行 build_py 创建构建 创建 build/lib.linux-x86_64-2.7 复制 Python2/regex.py -> build/lib.linux-x86_64-2.7 复制 Python2/_regex_core.py -> build/lib.linux-x86_64-2.7 复制 Python2/test_regex.py -> build/lib.linux-x86_64-2.7 运行 build_ext 构建“_regex”扩展 创建 build/temp.linux-x86_64-2.7 创建 build/temp.linux-x86_64-2.7/Python2 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security - fPIC -I/usr/include/python2.7 -c Python2/_regex.c -o build/temp.linux-x86_64-2.7/Python2/_regex.o ****Python2/_regex.c:46:20: 致命错误: Python.h: 没有那个文件或目录 编译终止。**** 错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1
我认为出现这个问题是因为安装程序尝试将此包安装到 Python2.7 目录中,但我不确定。我尝试pip安装,从Python解释器启动,通过终端运行,但没有成功。请帮我解决这个问题。提前致谢。