utengr
utengr

Reputation: 3345

Virtual Environment for each project in Pycharm

I want to use a separate virtual environment for each project in Pycharm. For this purpose, I created a virtual environment for each project. I can not find a clear documentation if I need to activate/deactivate these virtual environments for each project when I want to add or remove things through PIP command or its done automatically in Pycharm terminal for that specific open project. I think it might be later case because when I use pip -V then I get a different virtual environment for each project.

Would be nice to hear from someone who has used virtual environment in Pycharm to see if I am on the right track.

I followed this method to create the virtual environment.

https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html

Upvotes: 5

Views: 4714

Answers (1)

nanotek
nanotek

Reputation: 3087

Yes, you are on the right track. However, the things which are happening are pretty explicit, not "automatically" and behind the scenes. In Settings | Project | Project Interpreter you select the interpreter (or virtual interpreter) you want to use/add packages/remove packages. When you create a virtual env you can select to share it between projects. For you, don't do this. If you did, just make sure all of your projects are pointing to different (virtual) interpreters and not the same one.

Upvotes: 5

Related Questions