How to reset sys.exec_prefix?

Steve Holden steve at holdenweb.com
Wed Aug 8 18:20:48 EDT 2007


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 -------------




More information about the Python-list mailing list