Skip to content

Commit 352a0e9

Browse files
Add venv instructions (#1007)
* Add venv instructions * update installation instruction in other places * Update README.md
1 parent 9aae44c commit 352a0e9

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

INSTALL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ Installation from PyPI
5656

5757
python -m pip install pyscipopt
5858

59+
To avoid interfering with system packages, it's best to use a [virtual environment](https://docs.python.org/3/library/venv.html).<br>
60+
<span style="color:orange">**Warning!**</span> This is mandatory in some newer configurations.
61+
62+
```bash
63+
python3 -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate pip install pyscipopt
64+
pip install pyscipopt
65+
```
66+
Remember to activate the environment (`source venv/bin/activate`) in each terminal session where you use PySCIPOpt.
67+
5968
Please note that if your Python version and OS version are in the combinations at the start of this INSTALL file then
6069
pip now automatically installs a pre-built version of SCIP. For these combinations, to use your own installation of SCIP,
6170
please see the section on building from source. For unavailable combinations this pip command will automatically

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ See [CHANGELOG.md](https://github.com/scipopt/PySCIPOpt/blob/master/CHANGELOG.md
2323
Installation
2424
------------
2525

26-
The recommended installation method is via PyPI
26+
The recommended installation method is via [PyPI](https://pypi.org/project/PySCIPOpt/):
27+
28+
```bash
29+
pip install pyscipopt
30+
```
31+
32+
To avoid interfering with system packages, it's best to use a [virtual environment](https://docs.python.org/3/library/venv.html):
33+
2734
```bash
35+
python3 -m venv venv # creates a virtual environment called venv
36+
source venv/bin/activate # activates the environment. On Windows use: venv\Scripts\activate
2837
pip install pyscipopt
2938
```
39+
Remember to activate the environment (`source venv/bin/activate` or equivalent) in each terminal session where you use PySCIPOpt.
40+
Note that some configurations require the use of virtual environments.
3041

3142
For information on specific versions, installation via Conda, and guides for building from source,
3243
please see the [online documentation](https://pyscipopt.readthedocs.io/en/latest/install.html).

docs/install.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ To install PySCIPOpt simply run the command:
2121
2222
pip install pyscipopt
2323
24+
To avoid interfering with system packages, it's best to use a `virtual environment <https://docs.python.org/3/library/venv.html>`.
25+
26+
.. warning::
27+
28+
Using a virtual environment is **mandatory** in some newer Python configurations
29+
to avoid permission and package conflicts.
30+
31+
.. code-block:: bash
32+
python3 -m venv venv
33+
source venv/bin/activate # On Windows use: venv\Scripts\activate
34+
pip install pyscipopt
35+
36+
Remember to activate the environment (``source venv/bin/activate``) in each terminal session where you use PySCIPOpt.
37+
2438
.. note:: For Linux users: PySCIPOpt versions newer than 5.1.1 installed via PyPI now require glibc 2.28+
2539

2640
For our build infrastructure we use `manylinux <https://github.com/pypa/manylinux>`_.

0 commit comments

Comments
 (0)