Installation¶
- If you are on Mac or Windows, we recommend installing Anaconda. Alternatively, install pip and create a virtual environment.
- (optional) Install the MOSEK solver as directed below
- Run
pip install gpkit
in the appropriate terminal or command prompt. - Open a Python prompt and run
import gpkit
to finish installation and run unit tests.
If you encounter any bugs please email gpkit@mit.edu
or raise a GitHub issue.
Installing MOSEK¶
GPkit interfaces with two off the shelf solvers: cvxopt, and MOSEK. Cvxopt is open source and installed by default; MOSEK requires a commercial licence or (free) academic license.
- Mac OS X
- If
which gcc
does not return anything, install the Apple Command Line Tools. - Download MOSEK 8, then:
- Move the
mosek
folder to your home directory - Follow these steps for Mac.
- Request an academic license file and put it in
~/mosek/
- Move the
- If
- Linux
- Download MOSEK 8, then:
- Move the
mosek
folder to your home directory - Follow these steps for Linux.
- Request an academic license file and put it in
~/mosek/
- Move the
- Windows
- Download MOSEK 8, then:
- Follow these steps for Windows.
- Request an academic license file and put it in
C:\Users\(your_username)\mosek\
- Make sure
gcc
is on your system path. - To do this, type
gcc
into a command prompt. - If you get
executable not found
, then install the 64-bit version (x86_64 installer architecture dropdown option) with GCC version 6.4.0 or older of mingw. - In an Anaconda command prompt (or equivalent), run
cd C:\Program Files\mingw-w64\x86_64-6.4.0-posix-seh-rt_v5-rev0\
(or whatever corresponds to the correct installation directory; note that if mingw is inProgram Files (x86)
instead ofProgram Files
you’ve installed the 32-bit version by mistake) - Run
mingw-64
to add it to your executable path. For step 3 of the install process you’ll need to runpip install gpkit
from this prompt.
- To do this, type
- Make sure
Debugging your installation¶
- You may need to rebuild GPkit if any of the following occur:
- You install MOSEK after installing GPkit
- You see
Could not load settings file.
when importing GPkit, or Could not load MOSEK library: ImportError('expopt.so not found.')
To rebuild GPkit run python -c "from gpkit.build import rebuild; rebuild()"
.
- If that doesn’t solve your issue then try the following:
pip uninstall gpkit
pip install --no-cache-dir --no-deps gpkit
python -c "import gpkit.tests; gpkit.tests.run()"
- If any tests fail, please email
gpkit@mit.edu
or raise a GitHub issue.
Bleeding-edge installations¶
Active developers may wish to install the latest GPkit directly from Github. To do so,
pip uninstall gpkit
to uninstall your existing GPkit.git clone https://github.com/convexengineering/gpkit.git
pip install -e gpkit
to install that directory as your environment-wide GPkit.cd ..; python -c "import gpkit.tests; gpkit.tests.run()"
to test your installation from a non-local directory.