Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipenv does not update the virtual environment when the python version is updated in the Pipfile #6141

Open
Semnodime opened this issue Apr 26, 2024 · 2 comments
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged.

Comments

@Semnodime
Copy link

Issue description

pipenv install --python 3.12

Expected result

tail Pipfile -n 2
[requires]
python_version = "3.12"
pipenv run python -V
Python 3.12.2

Actual result

tail Pipfile -n 2
[requires]
python_version = "3.12"
pipenv run python -V
Python 3.10.12

Steps to replicate

pipenv install --python 3.12
mv Pipfile Pipfile.bak
pipenv --rm
pipenv install --python 3.10
mv Pipfile.bak Pipfile
pipenv install --python 3.12
pipenv run python -V
@matteius
Copy link
Member

This is expected behavior today. You are welcome to take on improving this logic to detect and prompt use to upgrade their virtualenv (which would be like invoking pipenv --rm and pipenv sync to recreate it.

@Semnodime
Copy link
Author

This is expected behavior

The pipenv help suggests otherwise:

Usage Examples:
   Create a new project using Python 3.7, specifically:
   $ pipenv --python 3.7

After a environment has been created with pipenv --python 3.10 , pipenv --python 3.12 won't inform the user that a virtual environment does already exist and won't be upgraded. The command exits with return code 0 which does suggest every wen't without errors. No virtual environment has been created though, in contrast to its internal command description.

@matteius matteius added the Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged.
Projects
None yet
Development

No branches or pull requests

2 participants