How to configure custom PYTHONPATH with VM and PyCharm?
Solution 1:
For PyCharm 5 (or 2016.1), you can:
- select Preferences > Project Interpreter
- to the right of interpreter selector there is a "..." button, click it
- select "more..."
- pop up a new "Project Interpreters" window
- select the rightest button (named "show paths for the selected interpreter")
- pop up a "Interpreter Paths" window
- click the "+" buttom > select your desired PYTHONPATH directory (the folder which contains python modules) and click OK
- Done! Enjoy it!
Solution 2:
Instructions for editing your PYTHONPATH or fixing import resolution problems for code inspection are as follows:
- Open Preferences (On a Mac the keyboard short cut is
⌘,
).
Look for
Project Structure
in the sidebar on the left underProject: Your Project Name
Add or remove modules on the right sidebar
EDIT: I have updated this screen shot for PyCharm 4.5