pyconfig-64.h:没有这样的文件或目录

1 投票
1 回答
5067 浏览
提问于 2025-04-17 21:26

我有一个新安装的Slackware 14.1 64位系统(Python 2.7.5),现在想通过pip安装pygraphviz。

当我运行:

pip install pygraphviz

时,我遇到了以下错误:

In file included from /usr/include/python2.7/Python.h:8:0,
                 from pygraphviz/graphviz_wrap.c:124:
/usr/include/python2.7/pyconfig.h:6:25: fatal error: pyconfig-64.h: No such file or     directory
 #include "pyconfig-64.h"
                     ^
compilation terminated.
error: command 'gcc' failed with exit status 1

提到的pyconfig.h文件是:

#include <bits/wordsize.h>

#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif

我四处查找,发现很多关于缺少pyconfig.h文件的信息,但没有关于64位版本的,我在寻找可以安装的包来解决这个问题时遇到了困难。我尝试使用rpm2tgz和Fedora上针对2.7.5的python-devel rpm,但问题没有解决。而且,由于我在使用slack,yum或apt-get命令并不适用,我需要知道在哪里可以找到实际的包。

1 个回答

2

要解决这个问题,你需要安装 Python 的开发包。

sudo apt-get install python2.7-dev

撰写回答