How to setup the python path?

I apparently don't understand how to configure pycharm.  As you can see from the attached image, pycharm does not like the reference to admin.jobstream.jobstreamsAdmin(), saying that admin is an unresolved reference.

As you can also see in the image, the directory "Modules" is a source directory (it is blue in the image) and inside it is the directory "admin" and inside that is the file "jobstream.py".  "admin" also has a file "__init__.py" defining it as a module.

So shouldn't that be enough to make pycharm resolve all the references?  What am I missing to get the reference to be resolved?  The code actually runs okay.

I'm running pycharm 2.6.3 on Linux.  My python interpreter is jython 2.5.2, but I have this problem with python 2.7.3, too.

Thanks,

Michael
pythonIDE.png
3 comments
Comment actions Permalink
Your file does not import the "admin" module. PyCharm does not resolve references which have not been imported.
0
Comment actions Permalink
You're right.  Importing "admin.jobstream" does solve the problem.  It should also not be necessary, I think.  If python can resolve it withtout an import, so should PyCharm.  The reference
        admin.jobstream.clickOk()
means to look in the admin module for jobstream.py and run the method clickOk().  I don't think an import should be needed.  Certainly, the code runs fine without it.

Thanks for the help,

Michael
0
Comment actions Permalink
Normal Python cannot resolve this without an import. Most likely your test runs within a context of a specific system, and the imports are provided by the test runner or another component of your environment.
0

Please sign in to leave a comment.