Search code examples
pythonpycharmpipenv

How do I exit from pipenv in pycharm?


To exit my pipenv in window's cmd, I need to type exit. deactivate works, but it does not really exit from pipenv. Instead, it just deactivates the virtualenv created by pipenv. However, in pycham>terminal, the terminal tab just closes without exiting pipenv when I type exit, making it impossible to exit from pipenv properly. Is there a workaround to this? Thank you.


Solution

  • I don't really know if you still need the answer, but there may be others that do...so I'll still share what worked for me.

    NOTE: I used backbox linux (an ubuntu based hacking distro) for this and not windows, however, since pycharm is an IDE, it should still have the same settings

    Typing deactivate only works temporarily...when you open a new terminal, the virtualenv will still persist, so I decided to remove the python interpreter altogether.

    For this, you'll need to go to the top left corner of your pycharm IDE where it says 'File', select settings (or you could just press Ctrl Alt s), go to 'Project <your_project_name>', you'll see 2 options:

    • Python Interpreter
    • Project Structure

    Click on Python Interpreter and go to the drop down menu and select No interpreter

    Alternatively, you could just look at the bottom right corner of pycharm, just below Event Log, you should see something like Pipenv (your_project_name) [Python 3.x.x].

    Click it and select Interpreter settings, it will still take you to the settings place...click the drop down and select No Interpreter.

    That's it! Good luck!