LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-18-2008, 11:38 PM   #1
nm_ashy
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Python installation and module related Question. Plz help.


Hello,

I am relatively new to linux and I have some issues with running python.

I am working on a lab network computer in which i donot have root permission. I have a local folder with all permissions.

The computer has python2.4 but I need 2.5 for running a simulator. So I compiled python2.5 in the /usr/local/myfolder/python2.5 that I have permission. I have added /usr/local/myfolder/python2.5/bin to the "path" variable using the "set" command. I also set the 'PYTHONPATH" variable to point to "usr/local/myfolder/python2.5/lib"

When I enter "python" in the command line from anywhere, version 2.5 opens up as expected. So I guess the "set path" was successful.

But when I try and run the simulator, it shows an error. The error is a keyError shown below

File "/projects/code/src/customlogger.py", line 60, in analysis
apply(self._log, (ANALYSIS, msg, args), kwargs)
File "/usr/lib/python2.4/logging/__init__.py", line 408, in format
s = self._fmt % record.__dict__
KeyError: 'funcName
'


Now my question is, since I have the PYTHONPATH set to the new location, shouldn't "import logging" in the code import that module from the new PYTHONPATH (there is a logging folder there) rather than the old place (as shown in bold in the error messaqe above) ?

The simulator is incompatible with older version so it would be great if someone could clarify what is happening here and tell me how to run the new version (I CANNOT install the new version as root)

I appreciate your time !! Thanks !!

Ash

Last edited by nm_ashy; 11-18-2008 at 11:39 PM.
 
Old 11-19-2008, 09:14 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,491

Rep: Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123Reputation: 8123
Quote:
Originally Posted by nm_ashy View Post
Hello,

I am relatively new to linux and I have some issues with running python.

I am working on a lab network computer in which i donot have root permission. I have a local folder with all permissions.

The computer has python2.4 but I need 2.5 for running a simulator. So I compiled python2.5 in the /usr/local/myfolder/python2.5 that I have permission. I have added /usr/local/myfolder/python2.5/bin to the "path" variable using the "set" command. I also set the 'PYTHONPATH" variable to point to "usr/local/myfolder/python2.5/lib"

When I enter "python" in the command line from anywhere, version 2.5 opens up as expected. So I guess the "set path" was successful.

But when I try and run the simulator, it shows an error. The error is a keyError shown below
Well, it could be two things, right off the top of my head. One is that you're running a script file to launch the simulator, and that script file has a Python path coded into it, or does something else wonky with your path. The second is (unlikely), your path statement has the old version of python included first...
 
Old 11-19-2008, 03:47 PM   #3
mmarshall
Member
 
Registered: Apr 2004
Location: Bedford, Texas (DFW area)
Distribution: ArchLinux
Posts: 41

Rep: Reputation: 15
Just to make sure you know what module path the code is using, try inserting the following lines in /projects/code/src/customlogger.py" before line 60:

Code:
import sys
print sys.path
Keep in mind that indentation is important in python.

MWM
 
Old 11-19-2008, 05:11 PM   #4
nm_ashy
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks people. The problem was, as TBone had mentioned, a script file in the simulator had python path encoded in it and was overwritinq the one I set.

Thanks !! You people are so helpful !!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 04:44 AM
GTK+, Python and related installed by hand Deleauvive Linux - Software 5 06-25-2008 07:36 PM
perl module installation question 2007fld Programming 5 07-20-2007 01:50 PM
module related question when compiling kernel taoweijia Linux - Newbie 1 02-10-2004 05:31 PM
Problems with installing GD perl module. Related to libgd installation. Chiabert Linux - Newbie 0 10-03-2003 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration