In order to not use System Python installation, we can use custom virtual environment tools (e.g. virtualenv, pyenv, ...) that copy and isolate System Python installation into project folder so that installation of custom packages are done per project/repository basis.
-
Install virtualenv (brew install virtualenv)
cd some-python-gitlab-repo # create virtual environment virtualenv --python=python3.8.7 venv # activate virtual environment (in terminal you should see (venv) indicator in path) source venv/bin/activate # ... now you can do stuff in your isolated python virtual environment ... # deactivates virtual environment deactivate
-
Install direnv
- Append to
~.zshrc
eval "$(direnv hook zsh)"
- Create
~/.config/direnv/config.toml
so thatcd
within defined prefix automatically loads.env
fileReplace[whitelist] prefix = [ "/Users/<<lastf>>/Projects/gitlab/umusic" ]
<<lastf>>
with UMG user.
- Append to