PyDev displays an undefined variable from import for 1 of 2 vars

Problem

I have the following structure:

home.py logic/brains/databeam.py 

Inside databeam.py I have:

 engine = create_engine(databaseSettings(), pool_size = 20, max_overflow = 0) Session = sessionmaker(bind = engine) session = Session() boom = 'boom' 

And in home.py :

 from logic.brains.databeam import session, boom print session print session.query() print boom 

Everything works as intended, but PyDev on eclipse shows me this:

red source

error message

It works when ...

Instead of using from logic.brains.databeam import session as session, boom as boom I do this:

 import logic.brains.databeam session = logic.brains.databeam.session boom = logic.brains.databeam.boom 

But this seems untidy, is there a better way to show PyDev that import is working?

+1
python pydev
Mar 20 '13 at 12:35
source share
3 answers

The solution I thought was reasonable is to completely eliminate this type of error in PyDev . I know that this is not perfect, but far and far the best I have come across.

How to change this parameter:

pydev settings change

+1
Mar 22 '13 at 21:46
source share

@Lars, I can not comment on the previous entry, so I will post my comment here. If you have a "Undefined variable from import" error, for example @Morgan Wilde with the request, you should put a Warning on this option under the Undefined not Imports tab.

+1
May 31 '15 at 10:38
source share

As a way around the problem, I used:

enter image description here

then a bunch

enter image description here

and

enter image description here

Will appear

. To hide them:

enter image description here

+1
Aug 20 '15 at 7:05
source share



All Articles