如何在Windows 7上为Python 3.5安装cvxopt [英] How to install cvxopt for Python 3.5 on Windows 7

查看:132
本文介绍了如何在Windows 7上为Python 3.5安装cvxopt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新到了python 3.5.0,并且想要安装cvxopt,到目前为止没有运气。因此,我尝试了python 2.7,并按照说明在这里安装了mingw(4.9.3)并构建了blas和lapack从源头上没有问题。
当我运行时

I recently updated to python 3.5.0 and want to install cvxopt, so far without luck. So I tried python 2.7 and following the instructions here i installed mingw (4.9.3) and built blas and lapack from source without issue. When I run

 python setup.py build --compiler=mingw32

我得到以下输出:

running build
running build_py
running build_ext
building 'base' extension
C:\minGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\
c/C/base.c -o build\temp.win32-2.7\Release\src\c\base.o
C:\minGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\
c/C/dense.c -o build\temp.win32-2.7\Release\src\c\dense.o
C:\minGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\
c/C/sparse.c -o build\temp.win32-2.7\Release\src\c\sparse.o
src/C/sparse.c: In function 'sparse_concat':
src/C/sparse.c:368:30: warning: variable 'blk_ncols' set but not used [-
but-set-variable]
         int_t blk_nrows = 0, blk_ncols = 0;
                              ^
writing build\temp.win32-2.7\Release\src\c\base.def
C:\minGW\bin\dllwrap.exe -mdll -static --entry _DllMain@12 --output-lib
mp.win32-2.7\Release\src\c\libbase.a --def build\temp.win32-2.7\Release\
se.def -s build\temp.win32-2.7\Release\src\c\base.o build\temp.win32-2.7
\src\c\dense.o build\temp.win32-2.7\Release\src\c\sparse.o -Lsrc -LC:\Py
ibs -LC:\Python27\PCbuild -LC:\Python27\PC\VS9.0 -lm -llapack -lblas -lg
-lpython27 -lmsvcr90 -o build\lib.win32-2.7\cvxopt\base.pyd
c:/mingw/bin/../lib/gcc/mingw32/4.9.3\libgfortran.a(write.o):(.text$writ
0xbb): undefined reference to `signbitq'
c:/mingw/bin/../lib/gcc/mingw32/4.9.3\libgfortran.a(write.o):(.text$writ
0xe7): undefined reference to `finiteq'
c:/mingw/bin/../lib/gcc/mingw32/4.9.3\libgfortran.a(write.o):(.text$writ
0x314): undefined reference to `finiteq'
c:/mingw/bin/../lib/gcc/mingw32/4.9.3\libgfortran.a(write.o):(.text$writ
0x7f2): undefined reference to `isnanq'
collect2.exe: error: ld returned 1 exit status
dllwrap: gcc exited with status 1
error: command 'C:\\minGW\\bin\\dllwrap.exe' failed with exit status 1

对于3.5,我使用Anaconda。 在此站点上,他们展示了如何通过conda命令安装cvxopt,以及当我尝试时这样,我得到未知的MS编译器版本1900 错误。
使用此补丁 ,安装将超过该点,但结束conda要安装的所有软件包都出错(不包括输出,因为太长了)

With 3.5 I use Anaconda. On this site they show how to install cvxopt via the conda command and when I try this, I get the Unknown MS Compiler version 1900 Error. Using this "patch" the installation gets past that point, but ends in errors for all packages conda wants to install (output not included, because too long)

版本3.5是否存在问题?还是mingw?还是64位水蟒?我正在尝试安装VC15,以查看是否会更改内容,但实际上根本不知道要查找的位置或内容。

Is this a problem with version 3.5? Or mingw? Or the 64 bit anaconda? I'm trying to install VC15 to see if that changes things, but have really no clue where or what to look out for.

编辑:
我仍​​然不知道到底是什么引起了问题,但是来自此网站的二进制文件,如建议的此处完美适用于Anaconda 64位和python 3.5(尽管您必须卸载numpy和scipy并使用网站上的版本)

I still don't know what exactly causes the problem, but the binaries from this site, as suggested here work perfectly for Anaconda 64 bit and python 3.5 (though you have to uninstall numpy and scipy and use the version from the site)

就minGW而言,它可能尚不适用于python 3.5 ,如评论此处为什么2.7给出了这些fortran错误,我根本无法说。

As for as minGW is concerned, it might not work with python 3.5 yet, as suggested in a comment here and why 2.7 gave these fortran errors I can't say at all.

推荐答案

这是一个很晚的答复,我看到你了已经为您的专业人士找到了解决方案通过安装自定义轮子可以解决问题。但是,我想针对您的具体问题指出另一种选择。由于您似乎正在使用Anaconda运行python 3.5,所以有一个rdonnelly渠道可能会帮助您。

it is a late reply and I see you already found a solution for your problem by installing the custom wheels. However I would like to point to another option for your specific problem. Since you are seemingly running python 3.5 with Anaconda there is a channel of rdonnelly who might help you out.

conda install -c rdonnelly cvxopt=1.1.9

此解决方案对于不准备安装自定义numpy和scipy的用户特别方便像我一样,因为他们两次破坏了我的python安装。这是我让cvxopt在win64 py35系统上运行的唯一方法。请注意,此软件包是为python 3.5量身定制的,默认情况下,当前的Conda将安装3.6。为此,我选择安装较早版本的Conda。

This solution is particularly handy for people not ready to install a custom numpy and scipy like myself, since they broke my python install twice. This was the only way I got cvxopt to run on my win64 py35 system. Note that this package is tailored for python 3.5 and the current Conda will install 3.6 by default. I chose to install an older release of Conda just for this purpose.

这篇关于如何在Windows 7上为Python 3.5安装cvxopt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆