1

我正在尝试在我的计算机(64 位 Windows 7)上安装 PyGSL,并安装了 Python 2.7 和 GSL 1.15。我几乎被困住了,我很想得到一些额外的帮助。GSL 安装得很好,但问题在于它的包装器。由于某种原因,我无法构建 pygsl。显然 gcc 是问题所在(在另一台 Windows 机器上遇到了同样的问题)。或者可能是 pygsl 似乎在使用名为 AMD64 的文件,而我的计算机是 x86。我很想为 pygsl 使用 windows 二进制文件,但它只存在于 python 2.5,我的项目需要 2.6 或更高版本。我已经为 GSL 使用了 windows 二进制文件并从源代码构建它,但无论哪种方式我都遇到了同样的问题。我尝试将 dll 从 GSL 复制到 pygsl 中,但这没有用。一些论坛提到了一个名为 gsl.dll 的文件,但我似乎找不到它。我'

我运行的cmds:

python setup.py install
python setup.py build
python setup.py build_ext -i
python setup.py build --compiler=mingw32

有任何想法吗??谢谢。

干杯,贝雷克帽

在 Cygwin 中得到与 windows cmd 提示符相同的消息。错误信息:

$ /cygdrive/c/Python27/python.exe setup.py build_ext -i
numpy
Forcing DISTUTILS_USE_SDK=1
Building testing ufuncs!
running build_ext
building 'errno' extension
C compiler: gcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wall -Wstrict-prototypes

compile options: '-DSWIG_COBJECT_TYPES=1 -DGSL_RANGE_CHECK=1 -DDEBUG=1 -DNUMERIC=0 -DPYGSL_GSL_MAJOR_VERSION=1 -DPYGSL_GSL_MINOR_VERSION=15 -UNDEBUG -IC:\Users\Bereket\gsl-1.15\include -IInclude -I. -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
gcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wall -Wstrict-prototypes -DSWIG_COBJECT_TYPES=1 -DGSL_RANGE_CHECK=1 -DDEBUG=1 -DNUMERIC=0 -DPYGSL_GSL_MAJOR_VERSION=1 -DPYGSL_GSL_MINOR_VERSION=15 -UNDEBUG -IC:\Users\Bereket\gsl-1.15\include -IInclude -I. -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c src/init/errorno.c -o build\temp.win-amd64-2.7\Release\src\init\errorno.o
Found executable C:\cygwin\bin\gcc.exe
gcc -g -mno-cygwin -shared build\temp.win-amd64-2.7\Release\src\init\errorno.o -LC:\Users\Bereket\gsl-1.15\lib -LC:\Python27\libs -LC:\Python27\PCbuild\amd64 -lgsl -lgslcblas -lm -lpython27 -lmsvcr90 -o C:\Python27\Lib\pygsl-0.9.5\pygsl\errno.pyd
build\temp.win-amd64-2.7\Release\src\init\errorno.o: In function `add_errno':
/cygdrive/c/Python27/Lib/pygsl-0.9.5/src/init/errorno.c:14: undefined reference to `__imp__PyInt_FromLong'
/cygdrive/c/Python27/Lib/pygsl-0.9.5/src/init/errorno.c:20: undefined reference to `__imp__PyDict_SetItemString'
build\temp.win-amd64-2.7\Release\src\init\errorno.o: In function `initerrno':
/cygdrive/c/Python27/Lib/pygsl-0.9.5/src/init/errorno.c:37: undefined reference to `__imp__Py_InitModule4_64'
/cygdrive/c/Python27/Lib/pygsl-0.9.5/src/init/errorno.c:40: undefined reference to `__imp__PyModule_GetDict'
collect2: ld returned 1 exit status
error: Command "gcc -g -mno-cygwin -shared build\temp.win-amd64-2.7\Release\src\init\errorno.o -LC:\Users\Bereket\gsl-1.15\lib -LC:\Python27\libs -LC:\Python27\PCbuild\amd64 -lgsl -lgslcblas -lm -lpython27 -lmsvcr90 -o C:\Python27\Lib\pygsl-0.9.5\pygsl\errno.pyd" failed with exit status 1
4

2 回答 2

1

我现在很确定我使用 Cygwin 安装的 GSL 失败/具有未解决的依赖关系。我现在正在尝试使用 Visual Studio 2010 安装它。这里有一些很好的网站:

指示

替代方法

于 2013-05-19T21:58:12.467 回答
0

为 Windows 安装 Python 2.7 编译器是一个很好的起点 http://www.microsoft.com/en-gb/download/details.aspx?id=44266

跑步python setup.py build_ext --inplace对我有用。如果这不起作用,请告诉我。您可能需要添加环境变量。

你的 Python 是 32 还是 64?检查打开 Python 并执行

import sys
sys.versions
于 2015-02-13T12:11:33.883 回答