-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
How to deactivate current environment entered by pipenv shell
?
#84
Comments
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 |
@kfirbreger thank you! |
What about adding a |
I do not think it is technically possible though; this is, like the activate script, not something we can hook into. |
Sorry, I was more thinking at a kind of alias: |
@ebuildy Yeah, that would be very helpful, but as I said, it is not possible. |
@uranusjr
|
I would do that in a second, but it’s much more complicated than it sounds. |
|
@abekroenem The request was for |
I was looking for the same. Thank you for the answer.
|
@oxfos I am not an expert here, however:
Again, I am not an expert and I might be wrong so take this all with a grain of salt |
@kfirbreger |
@kfirbreger Your observation is completely correct :) |
Typing |
would be great to get this documented or added as |
it says it when you enter |
This messaging seems to have been dropped somewhere when we realized we swapped out pew, @uranusjr wound up doing the final extraction of our patches and I assume we just overlooked this |
Would also be good to add it to docs or help output as well. That was the first place I went looking for it. |
It would be nice to also be included in The Hitchhiker's Guide to Python, where I came from. The use of pipenv above virtualenvwrapper was a bit unclear there. |
@jongio The documentation is wide open for pull request. Submit one if you want to add things to it. @kctong529 Please file an issue to that project instead. We don’t control what gets written there. |
@kfirbreger Thanks so much! $pipenv shell
Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated.
No action taken to avoid nested environments. |
@EstebanBorai
|
If anyone gets stuck with this one, try exiting twice, then load the shell. |
This doesn't technically work. It seemingly "works" until you try to re-activate the virtual environment and you get this response: For an easy time, use |
Great to find this discussion, I am facing similar problem, I will try those suggestions mentioned above. I believe there is still room for improvement on the management of virtual environments using pipenv. When I think I know what is going on, suddenly I got lost where I am. I am starting to use Ubuntu via WSL, when I was creating my developing environment in Ubuntu, I executed "pipenv install --dev" to install all packages, I believe this command has also created my virtual environment. But in the end of the installation, I didn't get any "(virtual environment)" displayed at the command line. When I run "pipenv shell" to spawn the virtual environment, the error below is raised. Edited on 2019/05/29. source /bin/activate -> after this command appeared my (virtual env) at the command line. But I am still confused though. |
@rjnfrazao Have you tried |
No. Many hanks for the suggestion. I will try it later. I didn't mention my following problem, but really appreciate your attention to go beyond my expectations. I believe this command would sort it out : I believe my case is explained and addressed in this issue: #3488 Edited on 2019/05/29 @jeyraof , it didn't work, actually as soon as my virtual environment was sorted out, at least I was able to execute the application using the python from my virtual env. However, I am facing another problem now. Well Keep walking. Thanks for info anyway. |
New user of pipenv, spent 20 minutes trying to figure this out. The very good --help is misleading as I was expecting the information on how to do this to be buried here. Perhaps add a hint to the help, as well as the message when trying to activate a shell when one has already been activated. Current
Proposed
|
Can anyone tell how do I re-activate it back again after I've exited out of the shell? |
@Abhishek5101 |
Try with deactivate or pipenv exit |
If you are using jupyter-notebook, you might want to look into adding your venv as a kernel to jupyter. This link might help: http://queirozf.com/entries/jupyter-kernels-how-to-add-change-remove |
what is the difference between exit and deactivate? |
checkout kfirbreger's comment. Exit is universal to shells, deactivate is specific to virtualenv! |
Where should I type
|
exit
command is correct way to deactivate current environment?The text was updated successfully, but these errors were encountered: