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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-18-2008, 11:38 PM
|
#1
|
LQ Newbie
Registered: Oct 2008
Posts: 2
Rep:
|
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.
|
|
|
11-19-2008, 09:14 AM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,491
|
Quote:
Originally Posted by nm_ashy
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...
|
|
|
11-19-2008, 03:47 PM
|
#3
|
Member
Registered: Apr 2004
Location: Bedford, Texas (DFW area)
Distribution: ArchLinux
Posts: 41
Rep:
|
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
|
|
|
11-19-2008, 05:11 PM
|
#4
|
LQ Newbie
Registered: Oct 2008
Posts: 2
Original Poster
Rep:
|
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 !!
|
|
|
All times are GMT -5. The time now is 09:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|