Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 444
utengr Avatar asked Jul 14 '17 13:07

utengr


1 Answers

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.

like image 69
nanotek Avatar answered Sep 23 '22 15:09

nanotek