Austin Schuh | 9049e20 | 2022-02-20 17:34:16 -0800 | [diff] [blame^] | 1 | Python |
| 2 | ====== |
| 3 | |
| 4 | Python interface supports Python 2.7 and 3.5 or newer. |
| 5 | |
| 6 | Pip |
| 7 | ---- |
| 8 | |
| 9 | .. code:: bash |
| 10 | |
| 11 | pip install osqp |
| 12 | |
| 13 | |
| 14 | Anaconda |
| 15 | -------- |
| 16 | |
| 17 | .. code:: bash |
| 18 | |
| 19 | conda install -c conda-forge osqp |
| 20 | |
| 21 | |
| 22 | Sources |
| 23 | --------- |
| 24 | You need to install the following (see :ref:`build_from_sources` for more details): |
| 25 | |
| 26 | - `GCC compiler <https://gcc.gnu.org/>`_ |
| 27 | - `CMake <https://cmake.org/>`_ |
| 28 | |
| 29 | .. note:: |
| 30 | |
| 31 | **Windows**: You need to install **also** the Visual Studio C++ compiler: |
| 32 | |
| 33 | * Python 2: `Visual C++ 9.0 for Python (VC 9.0) <https://www.microsoft.com/en-us/download/details.aspx?id=44266>`_ |
| 34 | |
| 35 | * Python 3: `Build Tools for Visual Studio 2017 <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017>`_ |
| 36 | |
| 37 | |
| 38 | Now you are ready to build OSQP python interface from sources. Run the following in your terminal |
| 39 | |
| 40 | .. code:: bash |
| 41 | |
| 42 | git clone --recurse-submodules https://github.com/osqp/osqp-python |
| 43 | cd osqp-python |
| 44 | python setup.py install |