You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Pipenv in conjunction with Pyenv and in order for Pipenv to respect Pyenv's global and local Python versions, I set the $PIPENV_PYTHON environment variable to the following value $PYENV_ROOT/shims/python as per this section of the Pipenv documentation.
When the $PIPENV_PYTHON env variable is set followed by creating and activating a virtual environment, the value from the $PIPENV_PYTHON env variable is appended to the end of the "usual" $VIRTUAL_ENV value and stored in the $VIRTUAL_ENV env variable as its new value.
As an example:
usually in "normal" circumstances the $VIRTUAL_ENV would have the following value: /Users/user_name/.local/share/virtualenvs/test_environment-PVGY9Ddq
however, when the $PIPENV_PYTHON env variable is set, then the $VIRTUAL_ENV becomes /Users/user_name/.local/share/virtualenvs/test_environment-PVGY9Ddq-/Users/user_name/.pyenv/shims/python
This discussion was converted from issue #752 on June 11, 2021 16:17.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using Pipenv in conjunction with Pyenv and in order for Pipenv to respect Pyenv's global and local Python versions, I set the
$PIPENV_PYTHON
environment variable to the following value$PYENV_ROOT/shims/python
as per this section of the Pipenv documentation.When the
$PIPENV_PYTHON
env variable is set followed by creating and activating a virtual environment, the value from the$PIPENV_PYTHON
env variable is appended to the end of the "usual"$VIRTUAL_ENV
value and stored in the$VIRTUAL_ENV
env variable as its new value.As an example:
$VIRTUAL_ENV
would have the following value:/Users/user_name/.local/share/virtualenvs/test_environment-PVGY9Ddq
$PIPENV_PYTHON
env variable is set, then the$VIRTUAL_ENV
becomes/Users/user_name/.local/share/virtualenvs/test_environment-PVGY9Ddq-/Users/user_name/.pyenv/shims/python
This is not captured in the logic currently implemented in the venv.zsh and the
venv
name is shown aspython
as a result ofvenv="$VIRTUAL_ENV:t"
on line 37I am currently working around this by changing the
spaceship_venv()
to the followingHowever, I don't think that this captures all the edgecases
Beta Was this translation helpful? Give feedback.
All reactions