468,284 Members | 1,612 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,284 developers. It's quick & easy.

unable to import modules from other folders

Hi friends

I have a module "bigbee" in folder C:\MyDocs\BigBee and another module
"foo" needs to import from this.however, "foo" is in D:\foo.

foo.py :

from bigbee import *

The error i get is:

ImportError: No Module bigbee.

Please provide a solution.
Jun 27 '08 #1
1 1286
C:\MyDocs needs to be in the sys.path variable for python to include
it in it's search for modules

Try this:

import sys
sys.path.append('C:\MyDocs')

If you are packaging your program for reuse or later move that folder
bear in mind it will *break*

A better method would be to place the module into site-packages OR in
the same directory as the Py script that uses it.

:)

Tom

On 6/10/08, moijes12 <mo******@gmail.comwrote:
Hi friends

I have a module "bigbee" in folder C:\MyDocs\BigBee and another module
"foo" needs to import from this.however, "foo" is in D:\foo.

foo.py :

from bigbee import *

The error i get is:

ImportError: No Module bigbee.

Please provide a solution.
--
http://mail.python.org/mailman/listinfo/python-list

--
Thomas Morton

Lead Developer || Founder
TomNRob Web Services
www.tomnrob.com
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Markus Doering | last post: by
9 posts views Thread by Frantisek Fuka | last post: by
2 posts views Thread by Fritz Bosch | last post: by
11 posts views Thread by Connelly Barnes | last post: by
49 posts views Thread by Martin Unsal | last post: by
10 posts views Thread by Thomas Guettler | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.