472,118 Members | 1,012 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,118 software developers and data experts.

How to reset sys.exec_prefix?

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
2 2283
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
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.

Similar topics

9 posts views Thread by Ken | last post: by
6 posts views Thread by Ramachandran Subramanian | last post: by
1 post views Thread by NancyASAP | last post: by
2 posts views Thread by Roger Withnell | last post: by
11 posts views Thread by newbie | last post: by
16 posts views Thread by Giovanni D'Ascola | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.