Update venv example to pin to specific python version

This commit is contained in:
Charlie O'Keefe 2019-03-30 10:35:19 -06:00
parent 46827bfabc
commit d0d897b0a3
1 changed files with 11 additions and 1 deletions

View File

@ -273,10 +273,20 @@ zcash-gitian$ /usr/local/python3 --version
Python 3.7.3 Python 3.7.3
``` ```
You may also want to check if the `python3` in `PATH` is a symlink to a versioned location, if you
are using a system (like `brew`) that can manage multiple installed versions. This way, our virtual
environment will remain pinned to a specific python version even after a newer python version is
installed later.
```
$ ls -n /usr/local/bin/python3
lrwxr-xr-x 1 501 20 34 Mar 30 09:35 /usr/local/bin/python3 -> ../Cellar/python/3.7.3/bin/python3
```
We can use python's built-in `venv` module to create a virtual environment: We can use python's built-in `venv` module to create a virtual environment:
``` ```
zcash-gitian$ /usr/local/bin/python3 -m venv local/python_v3.7.3_venv zcash-gitian$ /usr/local/Cellar/python/3.7.3/bin/python3 -m venv local/python_v3.7.3_venv
``` ```
Translation: "Create a virtual environment at ./local/python_v3.7.3_venv". Translation: "Create a virtual environment at ./local/python_v3.7.3_venv".