pipenv: Wrong Python inside of 'pipenv shell'
Inside of the pipenv shell subshell, I expected python to point to .venv/bin/python, but:
$ pipenv --version
pipenv, version 3.3.2
$ pipenv shell
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
$ which python
/Users/Browning/.pyenv/shims/python
$ which -a python
/Users/Browning/.pyenv/shims/python
/Users/Browning/.local/share/virtualenvs/virtualboombox/bin/python
/Users/Browning/.pyenv/versions/3.6.0/bin/python
/Users/Browning/.pyenv/shims/python
/usr/local/bin/python
/usr/bin/python
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (14 by maintainers)
Or maybe you should move
pyenv initinto.bash_profileinstead (I am not sure what is zsh’s equivalent).profileis for login shells, and only evaluated once;rcis for non-login shells.pipenv shelllaunches non-login shells.@uranusjr This is genius!!
I just tested, it works as expected and feels much cleaner than my version. For reference the
zshequivalent of.bash_profileis.zlogin: http://zsh.sourceforge.net/Intro/intro_3.htmlThanks for teaching me about login vs interactive shells. I’m switching to your version 👍
@jacebrowning yeah, this is a specific behaviour of
pew. I’ve looked into a possible patch there, but don’t have anything that works with their idea of how virtualenvs work. ThePIPENV_SHELL_COMPATenv variable is the way to go withpyenv.