# 4 Installation¶

## 4.1 Only Python¶

If MOSEK is only used from Python, then to easily install the latest version together with all the binary dependencies we recommend:

• Users of the Anaconda Python distribution can install MOSEK as an Anaconda package, see https://anaconda.org/MOSEK/mosek. The quick way is

conda install -c mosek mosek

• Alternatively use the PIP installer with:

pip install -f https://download.mosek.com/stable/wheel/index.html Mosek --user


(skip --user for a system-wide installation).

## 4.2 General setup¶

### 4.2.1 Linux¶

1. Download the Linux 64bit x86 MOSEK Optimization Suite distribution from https://mosek.com/downloads/ and unpack it into a chosen directory.

2. Optionally add the path

<MSKHOME>/mosek/9.2/tools/platform/linux64x86/bin


to the OS variable PATH, where <MSKHOME> is the directory where MOSEK was installed.

### 4.2.2 Mac OS¶

1. Download the MAC OS 64bit x86 MOSEK Optimization Suite distribution from https://mosek.com/downloads/ and unpack it into a chosen directory.

2. Run the command

python <MSKHOME>/mosek/9.2/tools/platform/osx64x86/bin/install.py


where <MSKHOME> is the directory where MOSEK was installed. This will set up the appropriate shared objects required when using MOSEK.

3. Optionally add the path

<MSKHOME>/mosek/9.2/tools/platform/osx64x86/bin


to the OS variable PATH.

4. Troubleshooting:

• Missing otool. If running the install.py script produces errors such as:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
...
CalledProcessError: Command '['otool', '-L', '/users/username/mosek/9.0/tools/platform/osx64x86/bin/MOSEKLM']' returned non-zero exit status 1


then you need to install the command line tools, in particular otool. This can be done with

xcode-select --switch /Library/Developer/CommandLineTools

• Security exception in MacOS 10.15 (Catalina). If an attempt to run MOSEK on Mac OS 10.15 (Catalina) and later produces security exceptions (developer cannot be verified and similar) then use xattr to remove the quarantine attribute from all MOSEK executables and binaries. This can be done in one go with

xattr -dr com.apple.quarantine mosek


where mosek is the folder which contains the full MOSEK installation or MOSEK binaries. See https://themosekblog.blogspot.com/2019/12/macos-1015-catalina-mosek-installation.html for more information. If that does not help, use the system settings to allow running arbitrary unverified applications.

### 4.2.3 Windows, MSI installer¶

1. Make the right choice between the 32bit and 64bit versions. For instance if you plan to use MOSEK with 32bit Python or MATLAB the 32bit version of MOSEK should be selected. In general it is recommend to use the 64bit version though.

2. Download the Windows 32bit x86 or Windows 64bit x86 MOSEK Optimization Suite MSI installer from https://mosek.com/downloads/.

3. Run the installer to complete the installation.

4. Check that the path

<MSKHOME>\mosek\9.2\tools\platform\<PLATFORM>\bin


was added to the OS variable PATH, where <MSKHOME> is the directory where MOSEK was installed and <PLATFORM> is win64x86 or win32x86 depending on the version of MOSEK installed. This is necessary for Windows to locate the MOSEK shared libraries.

### 4.2.4 Windows, Manual installation¶

1. Make the right choice between the 32bit and 64bit versions. For instance if you plan to use MOSEK with 32bit Python or MATLAB the 32bit version of MOSEK should be selected. In general it is recommend to use the 64bit version though.

2. Download the Windows 32bit x86 or Windows 64bit x86 MOSEK Optimization Suite distribution from https://mosek.com/downloads/ and unpack it into a chosen directory.

3. Add the path

<MSKHOME>\mosek\9.2\tools\platform\<PLATFORM>\bin


to the OS variable PATH, where <MSKHOME> is the directory where MOSEK was installed and <PLATFORM> is win64x86 or win32x86 depending on the version of MOSEK installed. This is necessary for Windows to locate the MOSEK shared libraries, especially if MOSEK is to be used e.g. from MATLAB.

## 4.3 Setting up the License¶

Regardless of the method of installation, MOSEK requires a license file to run.

Token server setup

If you are using a floating license with a token server then follow the instructions in the Licensing Guide. This step is NOT required for trial and personal academic licenses in particular.

Client setup

In practice the license is contained in a file called

mosek.lic


which should typically be saved to a file called

%USERPROFILE%\mosek\mosek.lic           (Windows)
\$HOME/mosek/mosek.lic                   (Linux, MacOS)


If the folder mosek in the home directory does not exists, then it should be created. The license can be tested with the program msktestlic. For further information about the license system, and other non-standard ways of setting up the license, please consult the License Guide.

## 4.4 Finishing up¶

Important

• See the Licensing Guide if you need more advanced help setting up the license.
• For most languages and interfaces some additional steps are required. Please follow the instructions in the relevant interface documentation available from https://mosek.com/documentation/.