Skip to main content
GameDev.net gamedev.net
🔒 Locked

Importing Modules in Python

Started by LeafieTail Mar 12, 2011 at 7:34 AM 2 replies 1.5k views
Original Post
LeafieTail
LeafieTail
I am having trouble importing modules in python. Can someone help me so I can do object oriented programmed games.
SriLumpa
SriLumpa
Many people can probably help you, but you have to be more specific: show the error, the problematic import code, and whether the module is installed on your system.
The Communist Duck
The Communist Duck
import antigravity

Did you know that actually works?

You must have some weird error, since to import module foo, you do:
import foo
ChaosEngine
ChaosEngine
The most likely reason is that your module is not in the search path.

From the python module docs
When a module named spam is imported, the interpreter searches for a file named spam.py in the current directory, and then in the list of directories specified by the environment variable PYTHONPATH. This has the same syntax as the shell variable PATH, that is, a list of directory names.[/quote]
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.