question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mosek install error

See original GitHub issue

Running with Anaconda2, Python 3.7, Mosek 8 (although I also saw this issue when running with Mosek 9) on someone else’s machine. Got this error:

Traceback (most recent call last):
  File "C:/Users/burton.michael/Pegasus_MVP/pegasus_gp/cases.py", line 306, in <module>
    sol = mis.solve('mosek')
  File "C:\Users\burton.michael\AppData\Roaming\Python\Python37\site-packages\gpkit\constraints\prog_factories.py", line 124, in solvefn
    result = progsolve(solver, verbosity, **kwargs)
  File "C:\Users\burton.michael\AppData\Roaming\Python\Python37\site-packages\gpkit\constraints\gp.py", line 152, in solve
    solverfn, solvername = _get_solver(solver, kwargs)
  File "C:\Users\burton.michael\AppData\Roaming\Python\Python37\site-packages\gpkit\constraints\gp.py", line 40, in _get_solver
    from .._mosek import expopt
  File "C:\Users\burton.michael\AppData\Roaming\Python\Python37\site-packages\gpkit\_mosek\expopt.py", line 17, in <module>
    from .baked_ctypesgen import load_library, String, c_void, POINTER, UNCHECKED
  File "C:\Users\burton.michael\AppData\Roaming\Python\Python37\site-packages\gpkit\_mosek\baked_ctypesgen.py", line 376
    except OSError,e:
                  ^
SyntaxError: invalid syntax

When I run python python -c "from gpkit.build import build; build()" it looks good so I’m surprised that this is not working

I get this result

# Moving to the directory from which GPkit was imported.
Started building gpkit...

Attempting to find and build solvers:

# Looking for mosek
#     Found C:\Program Files\Mosek\8\tools\platform\win64x86\h\mosek.h
#     Found C:\Program Files\Mosek\8\tools\platform\win64x86\bin\mosek64_8_1.dll
#     Found C:\Program Files\Mosek\8\tools\examples\c\scopt-ext.c
#     Found C:\Program Files\Mosek\8\tools\examples\c\expopt.c
#     Found C:\Program Files\Mosek\8\tools\examples\c\dgopt.c
#     Found C:\Program Files\Mosek\8\tools\examples\c\scopt-ext.h
#     Found C:\Program Files\Mosek\8\tools\examples\c\expopt.h
#     Found C:\Program Files\Mosek\8\tools\examples\c\dgopt.h
#     Found C:\Program Files\Mosek\8\tools\platform\win64x86\h\mosek.h
# Found mosek version 8, installed to C:\Program Files\Mosek
#
# Building mosek...
#     Replacing directory _mosek\build
#
#   Copying expopt library files to _mosek\build
#     Copying C:\Program Files\Mosek\8\tools\examples\c\scopt-ext.c
#     Copying C:\Program Files\Mosek\8\tools\examples\c\expopt.c
#     Copying C:\Program Files\Mosek\8\tools\examples\c\dgopt.c
#     Copying C:\Program Files\Mosek\8\tools\examples\c\scopt-ext.h
#     Copying C:\Program Files\Mosek\8\tools\examples\c\expopt.h
#     Copying C:\Program Files\Mosek\8\tools\examples\c\dgopt.h
#     Copying C:\Program Files\Mosek\8\tools\platform\win64x86\h\mosek.h
#
#   Applying expopt patches...
#
#     Change in _mosek\build\dgopt.con line 651
#     --         printf("Number of Hessian non-zeros: %d\n",nlh[0]->numhesnz);
#     ++ MSK_echotask(task,MSK_STREAM_MSG,"Number of Hessian non-zeros: %d\n",n
#
#     Change in _mosek\build\expopt.con line 566
#     --         printf("Warning: The variable with index '%d' has only positiv
#     ++ MSK_echotask(expopttask,MSK_STREAM_MSG, "Warning: The variable with in
#
#     Change in _mosek\build\expopt.con line 579
#     --         printf("Warning: The variable with index '%d' has only negativ
#     ++ MSK_echotask(expopttask,MSK_STREAM_MSG, "Warning: The variable with in
#
#     Change in _mosek\build\expopt.con line 1115
#     --     printf ("solsta = %d, prosta = %d\n", (int)*solsta,(int)*prosta);
#     ++ MSK_echotask(expopttask,MSK_STREAM_MSG, "solsta = %d, prosta = %d\n",
#
#   Building expopt library...
#     Calling 'gcc -fpic -shared -Wl,--export-all-symbols,-R "C:\Program Files\Mosek\8\tools\platform\win64x86\bin"    _mosek\build\scopt-ext.c _mosek\build\expopt.c _mosek\build\dgopt.c   "C:\Program Files\Mosek\8\tools\platform\win64x86\bin\mosek64_8_1.dll" -o C:\Users\burton.michael\AppData\Roaming\Python\Python37\site-packages\gpkit\_mosek\build\expopt.so'
##
### CALL BEGINS
### CALL ENDS
##
# Done building mosek
# Looking for mosek_cli
#   Trying to run mskexpopt...
#     Calling 'mskexpopt'
##
### CALL BEGINS
No filename given.
Usage:
     mskexpopt FILENAME [-primal] [-dual] [-p parameterfile]
Return code: 1052
Description: MSK_RES_ERR_FILE_OPEN [An error occurred while opening a file.]
### CALL ENDS
##
# Found mosek_cli in system path
# Looking for mosek_conif
#   Trying to import mosek...
# Found mosek_conif in Python path
# Looking for cvxopt
#   Trying to import cvxopt...
# Found cvxopt in Python path
...finished building gpkit.

Found the following solvers: mosek, mosek_cli, mosek_conif, cvxopt
#     Replacing directory env

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bqpdcommented, Jul 9, 2020

v0.9.9 is the last one to support Python2.7 and the mosek C-bindings interface for mosek 7/8

the current dev branch does not support either of those 😕

both v0.9.9 and the current dev branch support Python3, mosek 7/8 via the mosek_cli interface and mosek 9 via the mosek_conif interface

0reactions
mjburton11commented, Jul 9, 2020

ok so so I’m still confused here. mosek doesn’t work with python 3 but mosek_cli does? and does gpkit still support python 2.7?

What are the optimum settings here: python 2.7 or 3? gpkit dev? mosek 9 or 8?

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Installation — MOSEK Installation Guide 10.0.33
MOSEK client can be installed from the following package managers and repositories: ... If running the install.py script produces errors such as:.
Read more >
1 Technical Issues — MOSEK FAQ 10.0.29 - Documentation
If an attempt to install the Python interface results in an error such as. error: could not create 'build': Access is denied.
Read more >
4 Installation — MOSEK Optimization Toolbox for MATLAB ...
This can happen if MOSEK was installed manually and not using the MSI installer. The solution is to add the path <MSKHOME>\mosek\10.0\tools\platform\<PLATFORM>\ ...
Read more >
4 Installation — MOSEK Optimizer API for Python 10.0.33
In this section we discuss how to install and setup the MOSEK Optimizer API ... If an attempt to install the Python interface...
Read more >
MOSEK Installation Guide
This guide describes how to install the MOSEK Optimization Suite. In general MOSEK Optimization Suite must be installed on any computer where MOSEK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found