Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set pythonpath in intellij

Where is the PYTHONPATH set in Intellij community edition 15.X?

Following shows where I have already looked:

Python interpreter:

enter image description here

Python SDK:

enter image description here

Global Libraries:

enter image description here

So .. I can not find where to set the environment variables for $PYTHONPATH. Funny thing - I recall having been able to do so in version 14 Ultimate Edition. Is this a CE version difference?

like image 474
WestCoastProjects Avatar asked Dec 18 '22 18:12

WestCoastProjects


1 Answers

I arrive some four years late to this party ;-) but this is the solution I have just found to incorporate arbitrary directories in my project to the IntelliJ path for execution and import inspection:

TL;DR: The only thing you need to do is marking the directory containing the module you want to import as a 'Sources Root'

Some additional explanation: I was trying to make work an old LiEclipse project inside Intellij CE last edition and it was giving me hell because I couldn't find a way to modify the PYTHONPATH to add the folder containing the "DegreeDistributionsForGraphs" module I need

enter image description here

In the end I found it is as easy as marking the folder as a 'Sources Root', from that moment on import and execution resolution works properly

enter image description here

I'm using the last IntelliJ CE available (in fact downloaded today)

enter image description here

like image 148
pvm14 Avatar answered Dec 21 '22 10:12

pvm14