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

Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated. #6220

Open
bakemocho opened this issue Aug 4, 2024 · 0 comments
Open

Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated. #6220

bakemocho opened this issue Aug 4, 2024 · 0 comments
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged.

Comments

@bakemocho
Copy link

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

  1. Create and activate a virtual environment using pipenv shell.
  2. Deactivate the environment using the deactivate command.
  3. 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

@matteius matteius added the Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. label Aug 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