Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

python: sitecustomize checks path before remove

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

Closes #18338.

Signed-off-by: Samuel John <>
  • Loading branch information...
commit 10ba101c323f98118b427f291e15abc5b3732991 1 parent 56d86e0
@deiga deiga authored samueljohn committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  Library/Formula/python.rb
3  Library/Formula/python.rb
@@ -138,7 +138,8 @@ def install
# Fix 2)
# Remove brewed Python's hard-coded site-packages
- sys.path.remove('#{site_packages_cellar}')
+ if '#{site_packages_cellar}' in sys.path:
+ sys.path.remove('#{site_packages_cellar}')
# Fix 3)
# For all Pythons: Tell about homebrew's site-packages location.
Please sign in to comment.
Something went wrong with that request. Please try again.