我正在尝试在debian中安装biopython 1.65。我有依赖Numpy和Scipy。 当我尝试构建它时,它失败了:
python setup.py build
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
有人知道我该如何解决它?
非常感谢
答案 0 :(得分:1)
namespace WpfApplication55
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
TestCombo TC = new TestCombo();
public MainWindow()
{
DataContext = TC;
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
TC.Begin(60);
}
private void Button_Click1(object sender, RoutedEventArgs e)
{
TC.Begin(120);
}
}
public class TestCombo:INotifyPropertyChanged
{
private int someData;
public int SomeData
{
get { return someData; }
set { someData = value; RaisePropertyChanged("SomeData"); }
}
public void StartCount(int input)
{
SomeData = input;
while (input>0)
{
System.Threading.Thread.Sleep(1000);
input -= 1;
SomeData = input;
}
}
public void Begin(int input)
{
Action<int> Start = new Action<int>(StartCount);
IAsyncResult result = Start.BeginInvoke(input, null, null);
}
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged (string info)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
}
告诉预处理器搜索本地文件,如果它不存在,则预处理器将其更改为
#include "Python.h"
应位于#include <Python.h>
(作为参数传递给gcc)。许多Linux发行版默认没有安装头文件,因此您必须手动安装它。
/usr/include/python2.7
的标头文件附带包python2.7
您可以通过libpython2.7-dev
,aptitude
或synaptic
在包名后添加apt-cache search
来查找要安装的软件包(在这种情况下dev
);名称可能与安装的名称不同。
答案 1 :(得分:1)
在Fedora上遇到同样的问题,有什么帮助:
yum install python-devel