Integrate Anaconda into Pyenv

If you use Pyenv to install multiple Python versions side-by-side and installed Anaconda to create virtual environments for each of your projects, install pyenv-virtualenv to integrate them.

Anaconda without the pyenv-virtualenv integration overwrites the PATH, and places itself to the front before pyenv would be able to handle the Python command calls. pyenv-virtualenv seamlessly combines the functionality of pyenv and Anaconda to handle the multiple Python versions and virtual environments.

The source code is at

Install pyenv-virtualenv

Use Home Brew for the recommended installation

brew install pyenv-virtualenv

Add the initialization code to the ~/.bashrc, ~/.zshrc file:

if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

Leave a comment

Your email address will not be published. Required fields are marked *