1

I'm trying to use (and therefore install) an optimization package called mosek and more specifically to use it with python on a jupyter notebook.

It's a commercial package but since I'm working in academia, I have a free license.

This issue has been edited thanks to Paul insights.

My goal is to be able to use mosek in python 3.5 through jupyter.

1° My issue:

When I run the following line of code in jupyter notebook :

import mosek.fusion

I have the following error:

import mosek.fusion ---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-9-81543b63d59f> in <module>()
----> 1 import mosek.fusion

ImportError: No module named 'mosek.fusion'

2° What I did :

I first downloaded and installed mosek. I also added my licence in my folder mosek. (I did all the steps described here : http://docs.mosek.com/7.1/toolsinstall/Linux_UNIX_installation_instructions.html and added my academical license as well).

I then tried to run the line of code: import mosek.fusion which gave an error. I then tried to run:

import mosek

then I had no error. My conclusion is that mosek is (now, thanks to Paul), properly installed but that fusion module is missing.

I also search for any fusion file or folder in my mosek folder. I did not find any.

Is there a way to get this module fusion from mosek, and even better, is there a way to make it work?

Thank you all!

E.

probaPerception
  • 581
  • 1
  • 7
  • 19

4 Answers4

2

I believe that it installed it to your .local because you installed with the --user flag. In other words:

python setup.py install --user

Trying running the install without the --user flag. That should install it in your conda environment.

But I'm not sure that is your import problem. Perhaps the fusion module doesn't exist. Try ls-ing what is in this folder /home/edwin/.local/lib/python3.5/site-packages/mosek/. Maybe try from mosek import fusion.

Paul
  • 5,473
  • 1
  • 30
  • 37
  • 1
    You are right, I install it again without --user and it installs it in my conda environment. I then tried your advice from mosek import fusion but I had exactly the same error as before. I then try to look for a fusion file or folder in my mosek folder within conda, and there is no such file/folder... Any idea how I can get fusion ? I guess I will edit my question so that it gets more specific. Thank for your help, it helped me targeting my real issue. – probaPerception Apr 27 '16 at 15:50
1

Fusion is not yet available for Python3. It will in the next major release, i.e. MOSEK 8.

AndreaCassioli
  • 305
  • 2
  • 11
0

The easiest way to install Mosek (for using from Python) is to use the pip installer:

pip install git+http://github.com/MOSEK/Mosek.pip@v7.0.0#egg=mosek

You may also want to set the environement variable for the Mosek lisence explicitly, e.g.

os.environ.setdefault("MOSEKLM_LICENSE_FILE", license) where license is a server address or a file location.

However, Mosek Fusion is not yet available for Python 3

tschm
  • 2,905
  • 6
  • 33
  • 45
  • Thank you but I found a way to use Mosek and fusion with Python. I needed to use Python 2 instead of Python 3. – probaPerception May 15 '16 at 21:30
  • Installing via pip doesn't care whether you use Python 2 or Python 3. This is just a tool to make the install simpler and automated (maybe you have a testserver etc). – tschm May 17 '16 at 07:52
0

Keep on the MOSEK website. Version 8(beta) soon to be released will support Python 3.5. Also full Anaconda support will soon be available.

ErlingMOSEK
  • 391
  • 1
  • 7