Multiple Virtual Environments

I have a monolith repo with multiple micro-services each with their own virtual environment.

How can I set it up to have Pycharm bounce between using multiple virtual environments?

I have tried setting to a folder with links to the current venv that I want to use, but pycharm seems to get confused and continues using the last one.  I have tried invalidating caches to fix this but still not luck.

If it helps, each microservice is its own python package and has the venv inside that directory structure.


Comment actions Permalink

Wow, that's a bugger.  The simplest thing I can think of is to actually open one Pycharm instance per microservice subfolder, that should keep it in line with the Pycharm expectation that one project has one virtualenv.  

Comment actions Permalink

Any better solution?

Comment actions Permalink

Have you considered configuring all those virtualenvs as Project Interpreter in PyCharm and then just switch between them when needed?


Please sign in to leave a comment.