Error with sitecustomize after upgrade to 2.7.4 #19024

Closed
jezdez opened this Issue Apr 7, 2013 · 4 comments

Projects

None yet

3 participants

@jezdez
Contributor
jezdez commented Apr 7, 2013

Hi,

For scripts that I had installed before upgrade form 2.7.3 to 2.7.4 I now get this upon execution:

'import sitecustomize' failed; use -v for traceback

When running python /usr/local/lib/python2.7/site-packages/sitecustomize.py I get this:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sitecustomize.py", line 21, in <module>
    sys.path.remove('/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages')
ValueError: list.remove(x): x not in list

When going in sitecustomize.py and print sys.path I get:

['/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pdbpp-0.7.2-py2.7.egg',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL',
'/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyObjC',
'/Library/Python/2.7/site-packages']
@deiga
Contributor
deiga commented Apr 7, 2013

#18338 Addresses this already

@samueljohn
Contributor

looks like when the python formula was updated from 2.7.3 to 2.7.4 only URL was changed.

@samueljohn
Contributor

I pulled #18338 as a quick fix for you.
However, I just brew rm python and then brew install python and in my sitecustomize.py there is not a single "2.7.3".

@jezdez could you try to brew rm python and then install again? Perhaps the sitecustomize was not overwritten?
The "2.7.3" in the sys.path is suspicious!

I will rework the sitecustomize in the next week anyways. But for now I pulled @deiga's fix. Thanks!

@samueljohn samueljohn closed this Apr 7, 2013
@samueljohn
Contributor

I close this as "fixed" but @jezdez, you should double-check if which python is really the freshly brewed 2.7.4.

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.