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

How to reset sys.exec_prefix?

P: n/a
Somehow on my linux box I scrood things up and I lost my python path info.

If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where
it should show '/usr/'.

Is there a config file somewhere that I can change to fix this, or do I
need to do a rebuild/reinstall? Hope not.

Thanks,
B
Aug 8 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Bryan wrote:
Somehow on my linux box I scrood things up and I lost my python path info.

If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where
it should show '/usr/'.

Is there a config file somewhere that I can change to fix this, or do I
need to do a rebuild/reinstall? Hope not.

Thanks,
B
Actually to clarify a bit here's what I see:
>>sys.prefix
'/usr/local'
>>sys.path
['', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
'/usr/local/lib/python2.5/plat-linux2',
'/usr/local/lib/python2.5/lib-tk',
'/usr/local/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/local/lib/python2.5/site-packages/PIL']

I am thinking that the prefix is prepended to all the paths.

All my stuff lives in 'usr/lib/python2.5', so I was hoping by just
changing my prefix it would set the rest of the paths accordingly.

B
Aug 8 '07 #2

P: n/a
Bryan wrote:
Bryan wrote:
>Somehow on my linux box I scrood things up and I lost my python path info.

If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where
it should show '/usr/'.

Is there a config file somewhere that I can change to fix this, or do I
need to do a rebuild/reinstall? Hope not.

Thanks,
B

Actually to clarify a bit here's what I see:
>>sys.prefix
'/usr/local'
>>sys.path
['', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
'/usr/local/lib/python2.5/plat-linux2',
'/usr/local/lib/python2.5/lib-tk',
'/usr/local/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/local/lib/python2.5/site-packages/PIL']

I am thinking that the prefix is prepended to all the paths.

All my stuff lives in 'usr/lib/python2.5', so I was hoping by just
changing my prefix it would set the rest of the paths accordingly.
It looks like you've installed a local copy. By default, I seem to
remember, Python installs with a prefix of /usr/local, so if you have
/usr/local/bin on your PATH variable you will pick up a local copy in
preference to the standard version installed with the OS.

Try running

/usr/bin/python

and see if that original one is still there (which it probably will be).
Id so, all you need to do is uninstall the local version and things will
magically return to normal.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Aug 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.