question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to deactivate current environment entered by `pipenv shell`?

See original GitHub issue
❯ python -V
Python 2.7.10

❯ pipenv shell
Spawning environment shell (/bin/zsh).
source /Users/jeyraof/Work/fashion-keyword/.venv/bin/activate

❯ source /Users/jeyraof/Work/fashion-keyword/.venv/bin/activate

(fashion-keyword)❯ python -V
Python 3.6.0

(fashion-keyword)❯ deactivate

❯ python -V
Python 3.6.0

❯ exit

❯ python -V
Python 2.7.10

exit command is correct way to deactivate current environment?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:32
  • Comments:36 (10 by maintainers)

github_iconTop GitHub Comments

316reactions
kfirbregercommented, Jan 25, 2017

pipenv starts a new shell session with the virtualenv pathing instead of changing the pathing in the current shell session. That is why deactivate does not work. you need to exit the shell session. the exit command or CTRL-d will do the trick.

40reactions
ebuildycommented, Jun 25, 2018

What about adding a pipenv exit to “close” the environment (so it can be documented).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv & Virtual Environments
workon also deactivates whatever environment you are currently in, so you can quickly switch between environments. Deactivating is still the same: $ deactivate....
Read more >
Python venv: How To Create, Activate, Deactivate, And Delete
Once you have finished working on your project, it's a good habit to deactivate its venv. By deactivating, you leave the virtual environment....
Read more >
2 years, 7 months ago - codingforentrepreneurs.com
Yeah that's a common thing. Just close out the terminal (or type exit ) and navigate to your project again and pipenv shell...
Read more >
Using Python environments in VS Code
If one is found, then no other interpreters are searched for or listed as pipenv expects to manage all aspects. The extension also...
Read more >
Python Virtual Environments: A Primer
To get to this point, you began by creating a Python virtual environment named venv and then activated it in your current shell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found