Last active
April 22, 2024 15:54
-
-
Save pocin/c3e58af3b1f23ed62143b01f5c3f8904 to your computer and use it in GitHub Desktop.
Use conda+pyenv to manage python
This file contains hidden or 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
# $ brew install pyenv #pay attention to caveats ($ brew info pyenv) | |
# $ brew install pyenv-virtualenv | |
# this goes into .zshrc | |
export PYENV_ROOT=/usr/local/var/pyenv | |
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi | |
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi | |
# USE LIKE THIs | |
# $ pyenv install miniconda3-latest | |
# $ pyenv global miniconda3-latest | |
# $ conda create -n my_conda_env requests | |
# $ pyenv versions | |
# system | |
#* miniconda3-latest (set by /Users/pocin/.python-version) | |
# miniconda3-latest/envs/my_conda_env | |
# to activate conda virtualenv do | |
# pyenv activate my_conda_env | |
# For activating conda env when entering directory | |
# $ cd /path/to/dir | |
# $ pyenv local my_conda_env |
If anyone else has an issue activating a conda environment. I had success with the following:
pyenv activate miniconda3-latest/envs/my_conda_env
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey man @pocin, i unable to activate my_conda_env. I throw error like this:
Any idea?