GIDForums  

Go Back   GIDForums > Computer Programming Forums > Python Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 08-Mar-2006, 03:45
blacklusterseph blacklusterseph is offline
New Member
 
Join Date: Mar 2006
Posts: 2
blacklusterseph is on a distinguished road

Module import problem


I'm having trouble with importing modules for python2.3

The modules I want to import are located in:

/usr/local/lib/python2.3/site-packages

in various subdirectories. I've setup PYTHONPATH in my bash profile with the following:

PYTHONPATH = /usr/local/lib/python2.3/site-packages; export PYTHONPATH

While this works for some modules, it doesn't work for others. Even if I append the full path to a particular module to PYTHONPATH, the import function still can't find it. What's more is that this seems to be intermittent for certain modules. One minute, I can import a module from python using the import, command. If I try again later, the module can't be found. I was under the impression that if I simply gave the path to the top of the directory structure where my modules are kept, then python would search through sub-directories by its self until the file is found. I'm really stumped at the moment, any help would be appreciated.
  #2  
Old 24-Mar-2006, 19:24
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,635
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: Module import problem


Sorry no one's replied to you. I didn't notice this posting until just now.

Offhand, I would say this is not a problem w/ Python but a problem w/ your system setup, though I can't say for certain. What system are you using? Also, does it make a difference if you move the modules to somewhere else, like where the "normal" path is looking?

While I'm thinking about it, you might also try updating to Python v2.4. It's possible that it's a bug that's already been fixed.
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.
-------------
Common Sense v2.0-Striving to make the world a little bit smarter.
  #3  
Old 27-Mar-2006, 02:59
blacklusterseph blacklusterseph is offline
New Member
 
Join Date: Mar 2006
Posts: 2
blacklusterseph is on a distinguished road

Re: Module import problem


Thanks for your reply. The problem seems to be remidied now though. You were right, it was a problem with my setup, not with python. It seems I was using an outdated compiler when I was building the framework that was going to use python. Since then I've been experiencing other problems, but I guess I'll bug you experts in another thread. Thanks again for the reply.
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-client application using sockets shereen Java Forum 0 03-Mar-2006 09:25
Graphic problem in Unreal Tournament 2004 zerox Computer Software Forum - Games 10 09-Oct-2005 12:31
Runtime Problem involving "printf" in C Program supamakia C Programming Language 2 09-Oct-2005 10:09
a significant problem after installing Xp mohammad Computer Software Forum - Windows 10 09-Aug-2005 07:03

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:09.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.