简体   繁体   English

如何安装PyGSL? (Windows 7、64位,Python 2.7,GSL 1.15)

[英]How to install PyGSL? (Windows 7, 64 bit, Python 2.7, GSL 1.15)

I'm trying to install PyGSL on my computer (64 bit Windows 7), with Python 2.7 and GSL 1.15 installed. 我正在尝试在装有Python 2.7和GSL 1.15的计算机(64位Windows 7)上安装PyGSL。 I'm pretty much stuck and I would love for some extra help. 我几乎被困住了,我希望能得到一些额外的帮助。 GSL installed fine, but its the wrapper that's the problem. GSL安装得很好,但是问题在于它的包装器。 For some reason I can't build pygsl. 由于某种原因,我无法构建pygsl。 Apparently gcc is the problem (got the same problem on another windows machine). 显然gcc是问题所在(在另一台Windows计算机上也遇到了同样的问题)。 Or it could be that pygsl appears to be using a file named AMD64 while my computer is x86. 或者可能是pygsl在我的计算机为x86时似乎正在使用名为AMD64的文件。 I would love to use the windows binary for pygsl, but it only exists for python 2.5, and my project needs 2.6 or higher. 我想将Windows二进制文件用于pygsl,但仅适用于python 2.5,并且我的项目需要2.6或更高版本。 I've used both the windows binary for GSL and built it from source, but I get the same problem either way. 我已经将Windows二进制文件用于GSL,并从源代码构建了它,但是无论哪种方式,我都会遇到相同的问题。 I tried copying dlls from GSL into pygsl but that didn't work. 我尝试将GSL中的dll复制到pygsl中,但是没有用。 Some forums mentioned a file called gsl.dll but I can't seem to find it. 一些论坛提到了一个名为gsl.dll的文件,但我似乎找不到它。 I've also tried to use Cygwin and to compile with minGW32 to no avail. 我也尝试使用Cygwin并使用minGW32进行编译无济于事。

cmds I ran: 我跑的命令

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

Any ideas?? 有任何想法吗?? Thanks. 谢谢。

Cheers, Bereket 欢呼声,贝雷克特

Got the same message in Cygwin as in the windows cmd prompt. 在Cygwin中收到与Windows cmd提示符中相同的消息。 Error message: 错误信息:

$ /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

I'm pretty sure now that my GSL install with Cygwin failed / had unresolved dependencies. 我现在很确定我与Cygwin一起安装的GSL安装失败/具有未解决的依赖关系。 I'm now trying to install it with visual studio 2010. Here are some good sites for doing that: 我现在正尝试在Visual Studio 2010中安装它。以下是一些不错的网站:

Instructions 说明

Alt Method 替代方法

Installing the Python 2.7 compiler for Windows is a good place to start http://www.microsoft.com/en-gb/download/details.aspx?id=44266 为Windows安装Python 2.7编译器是开始http://www.microsoft.com/en-gb/download/details.aspx?id=44266的好地方

Running python setup.py build_ext --inplace does the trick for me. 运行python setup.py build_ext --inplace对我python setup.py build_ext --inplace If this doesn't work let me know. 如果这不起作用,请通知我。 You might need to add an environment variable. 您可能需要添加环境变量。

Is your Python 32 or 64? 您的Python是32还是64? To check open Python and do 检查打开的Python并执行

import sys
sys.versions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 出错:在Cygwin中构建64位GSL - make error: Building 64-bit GSL in Cygwin 使用64位GCC在Cygwin上编译64位GSL - Compiling 64-bit GSL on Cygwin using 64-bit GCC 在Windows 7(64位)上使用Cython和MinGW编译Python 3.5代码 - Compiling Python 3.5 code with Cython and MinGW on Windows 7 (64bit) 在64位Windows 10系统,Python 3上安装Theano的困难 - Difficulties installing Theano on 64-bit Windows 10 System, Python 3 我如何在(64位)Windows上编译c ++以制作64位exe? - How can I compile c++ on (64bit) windows to make a 64bit exe? 如何在 Debian 上安装 ELF 64 位 LSB 可执行文件? - How to install an ELF 64-bit LSB executable on Debian? 在没有安装gcc的情况下安装python 2.7 - Install python 2.7 with no gcc installed 你需要安装什么来在Windows上使用Clang来构建64位的c ++ 14? - What do you need to install to use Clang on windows to build c++14 for 64 bit? 由于gcc -m64标志错误,导致Windows 8 64位ruby-debug-ide安装的linecache19失败:抱歉,未实现:未在64位模式下编译 - Windows 8 64 bit ruby-debug-ide install of linecache19 failing due to gcc -m64 flag error: sorry, unimplemented: 64-bit mode not compiled in 如何从solaris上的源代码构建64位python - How to build 64 bit python from source on solaris
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM