import custom modules from a different directory

Hello (first time question here - :)),

Specs:
I'm on a Windows 7 machine, using PyCharm 4.0.1 CE.

What I'm hoping from my question:
Is there a better way to do what I'm doing? :) - Or do I need to employ some PyCharm setting magic to make this happen?

My Issue:
I'm currently using the following to import custom modules relative to the executing script:

sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..\\..\\my_python_libs\\'))
import my_lib_dir

Pycharm can't seem to resolve this.  So I usually just ignore the little Red underlines – and when I evaluate in Pycharm everything still works.  However, pressing f12 doesn't jump to the library :( – and obviously it can't see into the lib to tell me what functions/vars are available.  I would really like all this functionality and would like to know what I need to be a better PyCharmer.

Thanks in advance,

Jason

Please sign in to leave a comment.