【问题标题】:How to install PyGSL? (Windows 7, 64 bit, Python 2.7, GSL 1.15)如何安装 PyGSL? (Windows 7、64 位、Python 2.7、GSL 1.15)
【发布时间】:2013-05-15 21:00:15
【问题描述】:

我正在尝试在我的计算机(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 的文件,但我似乎找不到它。我也尝试使用 Cygwin 并使用 minGW32 进行编译,但无济于事。

我运行的命令:

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

【问题讨论】:

    标签: gcc windows-7 python-2.7 gsl pygsl


    【解决方案1】:

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

    Instructions

    Alt Method

    【讨论】:

      【解决方案2】:

      为 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-28
        • 2016-07-06
        相关资源
        最近更新 更多