Issue description
When deactivating a virtual environment created by pipenv shell and then trying to reactivate it using pipenv shell, I receive the error:
Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated.
New shell not activated to avoid nested environments.
However, running unset PIPENV_ACTIVE resolves the issue. Modifying the deactivate function in the virtual environment's activate script to include unset PIPENV_ACTIVE also works.
Expected result
The virtual environment should reactivate without errors when running pipenv shell after deactivating it.
Actual result
The error message is displayed, and the virtual environment is not reactivated.
Steps to replicate
- Create and activate a virtual environment using
pipenv shell.
- Deactivate the environment using the
deactivate command.
- Attempt to reactivate the environment using
pipenv shell.
System details
- OS: Darwin Machinename.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:17:33 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6031 arm64
- pyenv version: pyenv 2.4.7
- pipenv version: pipenv, version 2024.0.1
- Python version: Python 3.12.4
Additional information
To resolve the issue temporarily, adding unset PIPENV_ACTIVE to the deactivate function in the virtual environment's activate script works. However, this seems to be an issue with pipenv itself.
pipenv_support.md
Issue description
When deactivating a virtual environment created by
pipenv shelland then trying to reactivate it usingpipenv shell, I receive the error:However, running
unset PIPENV_ACTIVEresolves the issue. Modifying thedeactivatefunction in the virtual environment'sactivatescript to includeunset PIPENV_ACTIVEalso works.Expected result
The virtual environment should reactivate without errors when running
pipenv shellafter deactivating it.Actual result
The error message is displayed, and the virtual environment is not reactivated.
Steps to replicate
pipenv shell.deactivatecommand.pipenv shell.System details
Additional information
To resolve the issue temporarily, adding
unset PIPENV_ACTIVEto thedeactivatefunction in the virtual environment'sactivatescript works. However, this seems to be an issue with pipenv itself.pipenv_support.md