Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Stop failing sitecustomize if cellar not in path #18338

Closed
wants to merge 1 commit into from

Conversation

deiga
Copy link
Contributor

@deiga deiga commented Mar 8, 2013

This fixes issues when calling python scripts print 'import sitecustomize' failed; use -v for traceback

This fixes issues when calling python scripts print `'import sitecustomize' failed; use -v for traceback`
@samueljohn
Copy link
Contributor

I don't know how this can happen, that your python is at HOMEBREW_PREFIX but has not HOMEBREW/Cellar in the sys.path.

Having said that, the fix looks reasonable to me. Indeed, in the upcoming python rework, I have a similar line in:

          if sys.path.startswith('#{HOMEBREW_PREFIX}/Cellar'):
              sys.path.remove(p)

@deiga
Copy link
Contributor Author

deiga commented Mar 8, 2013

yeah, I don't know either how that could have even happened, but it caused some headaches with the weird error message :)

Of course that also could be extended with an else that outputs a warning that something is wrong with the pythonpath :)

@samueljohn
Copy link
Contributor

Did you first brew install python and then install the python from python.org (which also writes /usr/local/bin/python)?

We must not output from the sitecustomize.py, otherwise the output of executable python scripts is no longer parseable.

@deiga
Copy link
Contributor Author

deiga commented Mar 10, 2013

No, I only had system python installed and then I installed brew install python, I never downloaded python or installed from another source

@samueljohn
Copy link
Contributor

will be addressed by #18588.

@samueljohn
Copy link
Contributor

I pulled this as a kind of hot-fix until #18588 arrives.

@samueljohn
Copy link
Contributor

Thank you!

@ghost ghost assigned samueljohn Apr 7, 2013
@deiga deiga deleted the patch-1 branch April 7, 2013 17:23
dshean pushed a commit to dshean/homebrew that referenced this pull request Sep 24, 2013
This fixes issues when calling python scripts print `'import sitecustomize' failed; use -v for traceback`

Closes Homebrew#18338.

Signed-off-by: Samuel John <github@SamuelJohn.de>
@Homebrew Homebrew 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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants