1

I am making a game using pygame and PyDev. Whenever I reference any member of the pygame module (i. e. pygame.init), PyDev gives an "undefined variable from import" error, even though the code itself is perfectly fine. Members of submodules don't give this error message, and using from pygame.locals import * gives "undefined variable" errors.

I have tried adding pygame as a forced builtin, to no avail. I tried it again and it worked. I'm not sure what had happened before.

Code:

import pygame
pygame.init() <== Error raised here
1
  • can u provide your code..?? Commented Apr 26, 2017 at 6:37

1 Answer 1

3

Have you tried adding pygame to the Forced Builtins?

You can find more information on how to do that and why this may fix your issue at: http://www.pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-ForcedBuiltins

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.