【发布时间】:2016-02-27 11:06:08
【问题描述】:
我相信这可能是一个一般的 python/gcc 问题,不是 pyglpk 特有的。
我正在尝试在全新安装的 Ubuntu 14.04 上安装到 pyglpk。当我使用全新安装的 Ubuntu 时,Python 2.7 和 3 都已安装。 我相信我已经正确安装了列出的必需依赖项(GLPK 和 GMP),并且我已经安装了另一篇文章建议我可能缺少的其他依赖项:
apt-get install python-dev libxml2-dev libxslt-dev
这是我在尝试编译 pyglpk 时遇到的错误:
sudo make
python setup.py build
running build
running build_ext
building 'glpk' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -Isrc -I/usr/include/python2.7 -c src/glpk.c -o build/temp.linux-x86_64-2.7/src/glpk.o -m32
In file included from /usr/include/python2.7/Python.h:8:0,
from src/glpk.c:20:
/usr/include/python2.7/pyconfig.h:7:49: fatal error: i386-linux-gnu/python2.7/pyconfig.h: No such file or directory
# include <i386-linux-gnu/python2.7/pyconfig.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [all] Error 1
在我看来,它正在寻找的实际文件 (pyconfig.h) 在这里:
/usr/include/x86_64-linux-gnu/python2.7/pyconfig.h
而 make/gcc 似乎正在寻找 32 位 python 的等效文件:
/usr/include/i386-linux-gnu/python2.7/pyconfig.h
我将尝试安装 32 位 Ubuntu,即使我应该能够在 64 位系统上使用 32 位程序。我会在这里报告。
谢谢!
【问题讨论】:
-
如果您要对帖子投反对票,请说明我的帖子如何没有显示研究成果、不清楚或没有帮助。我已尽我所能研究了这个问题,并提供了我认为对手头问题的全面而清晰的描述。
-
考虑在askubuntu.com 发布这个问题。我还建议您安装 32 位库,例如
ia32-libs,不要忘记sudo dpkg --add-architecture i386 -
有趣。谢谢你的建议!我现在很想恢复到 64 位来尝试一下。在过去的 3 天里,我安装和重新安装 Ubuntu 的次数太多了!
-
不,那没用。它正在寻找 python 本身的 32 位版本,这需要我在 64 位旁边安装 32 位 python(这似乎是一个相当混乱的过程)。
标签: python ubuntu compiler-errors installation glpk