I'm trying to use QGIS, which requires python 3.6.x.
I'm on mac on a system that already has python 2.7 and 3.7.
I tried
brew update
brew install pyenv
brew install pyenv-virtualenv
pyenv install 3.6.5
It installs just fine. Then, when I try to activate
pyenv activate my-virtualenv
I get this error
Failed to activate virtualenv.
Perhaps pyenv-virtualenv has not been loaded into your shell properly. Please restart current shell and try again.
I tried again with
exec $SHELL
pyenv activate my-virtualenv
And received the same error.
I executed this command in bash-3.2$
and regular terminal
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
And I'm still getting the same error. How can I get an environment running that uses python 3.6?
virtualenv allows you to create local (per-directory), independent python installations by cloning from existing ones. pyenv allows you to install (build from source) different versions of Python alongside each other; you can then clone them with virtualenv or use pyenv to select which one to run at any given time.
conda integrates with pyenv and pyenv-virtualenv What is great about these environments is that we can create custom software environments to suit any project. We can install R packages, python modules, C/C++ executables, and more.
Try this: into the terminal,
write: nano ~/.bashrc
add in the end:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
~/.bashrc
And it's all, this worked for me.
Initialize pyenv
:
exec $SHELL
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv activate my-virtualenv
To save yourself some typing add this to your .bashrc
:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With