编译biopython1.65时发生错误:错误:命令'x86_64 linux-gnu-gcc'在退出状态1时失败

时间:2021-05-29 23:34:42

I am trying to install biopython 1.65 in debian. I have the dependencies Numpy and Scipy. When I try to build it, it fails:

我正在尝试在debian中安装biopython 1.65。我有依赖项Numpy和Scipy。当我尝试构建它时,它失败了:

python setup.py build

python的设置。py构建

running build running build_py running build_ext building 'Bio.cpairwise2' extension 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 Bio/cpairwise2module.c -o build/temp.linux-x86_64-2.7/Bio/cpairwise2module.o Bio/cpairwise2module.c:12:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

运行构建运行build_py运行build_ext构建的Bio。cpairwise2' extension x86_64 linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall - wstrict -prototype -fno-strict -D_FORTIFY_SOURCE=2 -g -fstack- protecack -strong -Wformat -Werror=format-security -fPIC -I -fPIC - s2.7 - sod -包括/usr。c - o构建/ temp.linux - x86_64 2.7 /生物/ cpairwise2module。o生物/ cpairwise2module。c:12:20:致命错误:Python。h:没有这样的文件或目录#包含“Python”。h”^编译终止。错误:命令'x86_64 linux-gnu-gcc'在退出状态1时失败

Somebody know how I can solve it?

有人知道我怎么解决吗?

Many thanks

非常感谢

2 个解决方案

#1


1  

#include "Python.h"

tells the preprocessor to search a local file, and if it doesn't exists there, the preprocessor changes it to

告诉预处理器搜索一个本地文件,如果它不存在,则预处理器将其更改为。

#include <Python.h>

which should be located in /usr/include/python2.7 (which is passed as argument to gcc). Many Linux distros don't have header files installed by default, so you have to install it manually.

它应该位于/usr/include/python2.7中(作为参数传递给gcc)。许多Linux发行版没有默认安装头文件,所以您必须手动安装它。

Header files for python2.7 are shipped with package libpython2.7-dev

python2.7的头文件随包libpython2.7-dev一起提供

You can find which package to install by searching it with aptitude, synaptic or apt-cache search adding dev after the package name (in that case python dev); the name could be different than the installed one.

您可以通过使用aptitude、synaptic或apt-cache搜索在包名之后添加dev来查找要安装的包(在这种情况下是python dev);名称可能与已安装的名称不同。

#2


1  

Had the same issue on Fedora, what helped was:

Fedora也有同样的问题,有帮助的是:

yum install python-devel

#1


1  

#include "Python.h"

tells the preprocessor to search a local file, and if it doesn't exists there, the preprocessor changes it to

告诉预处理器搜索一个本地文件,如果它不存在,则预处理器将其更改为。

#include <Python.h>

which should be located in /usr/include/python2.7 (which is passed as argument to gcc). Many Linux distros don't have header files installed by default, so you have to install it manually.

它应该位于/usr/include/python2.7中(作为参数传递给gcc)。许多Linux发行版没有默认安装头文件,所以您必须手动安装它。

Header files for python2.7 are shipped with package libpython2.7-dev

python2.7的头文件随包libpython2.7-dev一起提供

You can find which package to install by searching it with aptitude, synaptic or apt-cache search adding dev after the package name (in that case python dev); the name could be different than the installed one.

您可以通过使用aptitude、synaptic或apt-cache搜索在包名之后添加dev来查找要安装的包(在这种情况下是python dev);名称可能与已安装的名称不同。

#2


1  

Had the same issue on Fedora, what helped was:

Fedora也有同样的问题,有帮助的是:

yum install python-devel