Dani
Dani

Reputation: 2488

Pyenv activate does not run activate script with Fish Shell

My pyenv is working just fine, but it does not seem to be running my activate script located at /usr/local/var/pyenv/versions/project/bin/activate.fish

When activating my environment it gives the following output, but it does not echo anything from the activate script, which indicates that it is not running.

dani@localhost ~/d/project> pyenv activate project
pyenv-virtualenv: prompt changing not working for fish.

Of course I can just source the file manually, but I'm too eager to find out why it is not running. Is there some kind of debug mode? I'm not sure how to approach.

Upvotes: 5

Views: 4834

Answers (2)

fuxiang
fuxiang

Reputation: 11

try this:

set PYENV_ROOT $HOME/.pyenv
set -x PATH $PYENV_ROOT/shims $PYENV_ROOT/bin $PATH
pyenv rehash

Upvotes: 1

korkmaz
korkmaz

Reputation: 101

Actually,

Virtual environment is activated but the message just says that your prompt wasn't changed. Updating prompt was intentionally removed from fish shell. you can find detailed information here; https://github.com/pyenv/pyenv-virtualenv/issues/153

If you want to see virtual environment is really activated or not, run the following command;

pyenv which python

it should print something like; .pyenv/versions/{your-virtual-env}/bin/python

Upvotes: 5

Related Questions