[Tutor] Swampy: No module name World
Alan Gauld
alan.gauld at btinternet.com
Mon Jun 2 11:22:53 CEST 2014
On 02/06/14 02:33, Charles Agriesti wrote:
> from swampy.World import World
> world = World()
>
> ImportError: No module name World
>
> These scripts run with no problem as long as the file location is the
> python27 folder. But not from outside the folder.
It sounds like you installed swampy in the wrong place.
Python has a set of locations that it looks for modules.
One is the current directory. So if, for example, swampy
is in your Python27 folder that would explain it.
> Other modules, like math, import with no problem from other locations
Because the standard modules are in the location where
Python looks for them.
You can check the sys.path contents to see where Python
is looking. If swampy is not in any of those locations
Python won't se it.
> how can I fix this?
Probably by reinstalling swampy. But you'll need to check
their web site. This list is for core Python and standard
library. We can't offer much help for external modules.
You are best asking on dedicated forums.
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list