How to add external library to Python plugin in CLion?

All my Python files are dependent on other project.

I cannot find a configuration to specify python path.  I guess I can add it to Python itself, but then I would need to create new Python installation for each CLion project, which is quite inconvenient.



I managed to get this to work, finally. The trick is to set up a virtualenv and then put your changes to e.g. PYTHONPATH in the activate script. Then have CLion use the python inside the virtualenv. This made it possible to find all the local files associated with the project.


As an alternative:  in your virtual environment  ->lib ->site-packages  create a symbolic link to the external packages you want to access.  This works if you only have a few. 

I was unable to determine where the PYTHONPATH was set in the activate script.



Please sign in to leave a comment.