我在win7 / 64上,并且已经有一些蟒蛇,但是想要将mosek安装到新的WinPython
>where python
C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\python.exe
C:\Python27\python.exe
C:\Program Files (x86)\LilyPond\usr\bin\python.exe
我正在关注these instructions
>cd C:\Program Files\Mosek\7\tools\platform\win64x86\python\2
>python setup.py build --build-base c:\Users\nlab install --user
running build
running build_py
creating c:\Users\nlab\lib
creating c:\Users\nlab\lib\mosek
copying mosek\array.py -> c:\Users\nlab\lib\mosek
copying mosek\__init__.py -> c:\Users\nlab\lib\mosek
creating c:\Users\nlab\lib\mosek\fusion
copying mosek\fusion\SolverInfo.py -> c:\Users\nlab\lib\mosek\fusion
copying mosek\fusion\Utils.py -> c:\Users\nlab\lib\mosek\fusion
copying mosek\fusion\__init__.py -> c:\Users\nlab\lib\mosek\fusion
running install
running install_lib
creating C:\Users\nlab\AppData\Roaming\Python
creating C:\Users\nlab\AppData\Roaming\Python\Python27
creating C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages
creating C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
copying c:\Users\nlab\lib\mosek\array.py -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
creating C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion
copying c:\Users\nlab\lib\mosek\fusion\SolverInfo.py -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion
copying c:\Users\nlab\lib\mosek\fusion\Utils.py -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion
copying c:\Users\nlab\lib\mosek\fusion\__init__.py -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion
copying c:\Users\nlab\lib\mosek\__init__.py -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
byte-compiling C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\array.py to array.pyc
byte-compiling C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion\SolverInfo.py to SolverInfo.pyc
byte-compiling C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion\Utils.py to Utils.pyc
byte-compiling C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\fusion\__init__.py to __init__.pyc
byte-compiling C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek\__init__.py to __init__.pyc
running install_data
copying C:\Program Files\Mosek\7\tools\platform\win64x86\python\2\..\..\bin\mosek64_7_1.dll -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
copying C:\Program Files\Mosek\7\tools\platform\win64x86\python\2\..\..\bin\mosekglb64_7_1.dll -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
copying C:\Program Files\Mosek\7\tools\platform\win64x86\python\2\..\..\bin\mosekxx7_1.dll -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
copying C:\Program Files\Mosek\7\tools\platform\win64x86\python\2\..\..\bin\libiomp5md.dll -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
copying C:\Program Files\Mosek\7\tools\platform\win64x86\python\2\..\..\..\..\..\license.pdf -> C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\mosek
running install_egg_info
Writing C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\Mosek-7.1.31-py2.7.egg-info
Please review the MOSEK license conditions in license.pdf
创建和使用
C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\
但我想要
C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\Lib\site-packages\
我尝试明确地使用WinPython的exe:
>C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\python.exe setup.py build --build-base c:\Users\nlab install --user
running build
running build_py
running install
running install_lib
running install_data
running install_egg_info
Removing C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\Mosek-7.1.31-py2.7.egg-info
Writing C:\Users\nlab\AppData\Roaming\Python\Python27\site-packages\Mosek-7.1.31-py2.7.egg-info
Please review the MOSEK license conditions in license.pdf
但这似乎没有帮助
答案 0 :(得分:1)
我认为导致错误的是setup.py
选项。具体而言,user
选项将安装到链接到您的用户配置文件的特定目录中
https://docs.python.org/2/install/#alternate-installation-the-user-scheme
,无论与WinPython相关联的是什么。这适用于在系统目录中没有写权限的用户。如果要将安装链接到WinPython,请运行
C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\python.exe setup.py install
如果您想确保它安装在正确的位置,请使用--prefix选项
https://docs.python.org/2/install/#alternate-installation-windows-the-prefix-scheme
e.g。
python.exe setup.py install --prefix="C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\"
...但这不应该是必要的,因为这只是与此特定WinPython相关联的默认前缀。