diff --git a/INSTALL.md b/INSTALL.md index 86316fb99..9b2b44406 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -56,6 +56,15 @@ Installation from PyPI python -m pip install pyscipopt +To avoid interfering with system packages, it's best to use a [virtual environment](https://docs.python.org/3/library/venv.html).
+**Warning!** This is mandatory in some newer configurations. + +```bash +python3 -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate pip install pyscipopt +pip install pyscipopt +``` +Remember to activate the environment (`source venv/bin/activate`) in each terminal session where you use PySCIPOpt. + Please note that if your Python version and OS version are in the combinations at the start of this INSTALL file then pip now automatically installs a pre-built version of SCIP. For these combinations, to use your own installation of SCIP, please see the section on building from source. For unavailable combinations this pip command will automatically diff --git a/README.md b/README.md index 6bc0a5998..ed20f05c7 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,21 @@ See [CHANGELOG.md](https://github.com/scipopt/PySCIPOpt/blob/master/CHANGELOG.md Installation ------------ -The recommended installation method is via PyPI +The recommended installation method is via [PyPI](https://pypi.org/project/PySCIPOpt/): + +```bash +pip install pyscipopt +``` + +To avoid interfering with system packages, it's best to use a [virtual environment](https://docs.python.org/3/library/venv.html): + ```bash +python3 -m venv venv # creates a virtual environment called venv +source venv/bin/activate # activates the environment. On Windows use: venv\Scripts\activate pip install pyscipopt ``` +Remember to activate the environment (`source venv/bin/activate` or equivalent) in each terminal session where you use PySCIPOpt. +Note that some configurations require the use of virtual environments. For information on specific versions, installation via Conda, and guides for building from source, please see the [online documentation](https://pyscipopt.readthedocs.io/en/latest/install.html). diff --git a/docs/install.rst b/docs/install.rst index fce6368b1..ece2a3a94 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -21,6 +21,20 @@ To install PySCIPOpt simply run the command: pip install pyscipopt +To avoid interfering with system packages, it's best to use a `virtual environment `. + +.. warning:: + + Using a virtual environment is **mandatory** in some newer Python configurations + to avoid permission and package conflicts. + +.. code-block:: bash +python3 -m venv venv +source venv/bin/activate # On Windows use: venv\Scripts\activate +pip install pyscipopt + +Remember to activate the environment (``source venv/bin/activate``) in each terminal session where you use PySCIPOpt. + .. note:: For Linux users: PySCIPOpt versions newer than 5.1.1 installed via PyPI now require glibc 2.28+ For our build infrastructure we use `manylinux `_.