How to install cvxopt for Python 3.5 on Windows 7

岁酱吖の 提交于 2020-01-03 15:36:13

问题


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

I get the following output:

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

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)

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.

EDIT: 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)

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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/36431556/how-to-install-cvxopt-for-python-3-5-on-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!