Caleb Robinson
Caleb Robinson

Reputation: 1120

pyenv: "python >virtual env name< not installed"

I am having trouble with pyenv after updating my macOS to 11.5. This is what I tried:

$ pyenv install 3.8.11 --skip-existing
$ pyenv virtualenv 3.8.11 >virtual env name<
$ pyenv local >virtual env name<

All of this works fine. Running pyenv local results in printing my virtual env's name. But I can't install dependancies or do anything with pip:

$ pip freeze
python >virtual env name< not installed

I tried following this answer, but I still have the same problem.

Note: This is also happening with virtual envs that were previously working pre-update.

Upvotes: 1

Views: 552

Answers (1)

Caleb Robinson
Caleb Robinson

Reputation: 1120

Turns out the issue was with updating pyenv and not macOS. All I had to do was add the following lines to my ~./zshrc (or ~/.zprofile:

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"

Upvotes: 1

Related Questions