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.
There are some mentions of fish on wiki, but currently pyenv does not work in it. Namely, the problem is pyenv init, which tries to perform a bash eval inside fish, which, of course, fails. Installation/uninstallation of Python versions seems to work normally.
Since eval (pyenv init - fish) returns pyenv: no such command sh-'. Sorry, something went wrong. Oops. You're right. The initialization code has been changed during exporting this feature to rbenv ( rbenv/rbenv#434 ). Now I'm using following initialization code. Sorry, something went wrong. For posterity: pyenv now supports fish!
The virtualenv activates by sourcing (not normally running) the virtualenv/bin/activate script. If you want to do this in your own script, then you must source that script too and not just run it. Meaning:
Many of the code of pyenv is written in bash, but there are some of interactions between working shell. They might be the problem to support fish. Sorry, something went wrong. I'd personally be happy if init worked, I don't really use 2 or 3.
try this:
set PYENV_ROOT $HOME/.pyenv
set -x PATH $PYENV_ROOT/shims $PYENV_ROOT/bin $PATH
pyenv rehash
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
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