Discussion:
[Pydev-users] "Undefined variable from import" using Pygame
gustavk
2015-07-25 20:20:44 UTC
Permalink
Hi,

I'm using Pygame which is working without any problem with Python 3.4 in my virtualenv (Ubuntu 15.04) and Eclipse Luna release 2 (4.4.2)

The only problem is the false error triggered by Pydev for some modules from Pygame.



Strangely, it's not for all the imports:

`from pygame.locals import *` raises no error,



but doing:

-`pygame.init()` raises the `undefined variable from import` (after having done `import pygame`of course).

-Other import error:

Using constant defined by `from pygame.locals import *' (this module allows to import constants into the namespace): the locals.py imports itself in fact another file: constants.cpython-34m.so



I've tried adding `pygame` in forced builtins in the interpreter.



I've read different answers for this type of import problems but contrary to other, everything is running without problem, except these errors raised by Pydev.



It seems a problem with `.so` file (but I didn't find it for `pygame.init()`??). How is it possible to solve it?

Thanks !
Fabio Zadrozny
2015-07-30 18:00:35 UTC
Permalink
Strange that adding 'pygame' to the forced builtins didn't work... please
create an issue for that in the tracker (I have to reproduce your env
before being able to give you more feedback).

Cheers,

Fabio
Post by gustavk
Hi,
I'm using Pygame which is working without any problem with Python 3.4 in
my virtualenv (Ubuntu 15.04) and Eclipse Luna release 2 (4.4.2)
The only problem is the false error triggered by Pydev for some modules from Pygame.
`from pygame.locals import *` raises no error,
-`pygame.init()` raises the `undefined variable from import` (after having
done `import pygame`of course).
Using constant defined by `from pygame.locals import *' (this module
allows to import constants into the namespace): the locals.py imports
itself in fact another file: constants.cpython-34m.so
I've tried adding `pygame` in forced builtins in the interpreter.
I've read different answers for this type of import problems but contrary
to other, everything is running without problem, except these errors raised
by Pydev.
It seems a problem with `.so` file (but I didn't find it for
`pygame.init()`??). How is it possible to solve it?
Thanks !
------------------------------------------------------------------------------
_______________________________________________
Pydev-users mailing list
https://lists.sourceforge.net/lists/listinfo/pydev-users
Gus
2015-07-31 06:48:36 UTC
Permalink
Post by Fabio Zadrozny
Strange that adding 'pygame' to the forced builtins didn't work... please
create an issue for that in the tracker (I have to reproduce your env before
being able to give you more feedback).
Post by Fabio Zadrozny
Cheers,
Fabio
Thanks for your answer.
I've created a new issue (issue 602)




------------------------------------------------------------------------------
Loading...