Last active
May 16, 2022 08:14
-
-
Save izmailoff/9e499b663857da865396e05bda92a286 to your computer and use it in GitHub Desktop.
Setup virtual python environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OSX specific install commands: | |
brew install pyenv | |
pyenv install 3.6.8 | |
# or if fails: | |
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.6.8 | |
# the rest of the commands work both on OSX and Linux: | |
virtualenv -p /Users/alex/.pyenv/versions/3.6.8/bin/python venv | |
source venv/bin/activate | |
python setup.py develop # if you use setup.py file, otherwise pip install -r requirements.txt | |
python setup.py test | |
# ... | |
deactivate |
On Ubuntu:
sudo apt install python3.8
sudo apt install python3.8-distutils
sudo apt install python3.8-venv python3.8-dev
python3.8 -m venv env
In case Jupyter notebooks don't recognize/find your environment: https://janakiev.com/blog/jupyter-virtual-envs/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Fedora:
Article