By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

unable to import modules from other folders

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.