Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install python3 creates sitecustomize.py with syntax error #133488

Closed
4 tasks done
IzumiSy opened this issue Jun 13, 2023 · 2 comments · Fixed by #133490
Closed
4 tasks done

Install python3 creates sitecustomize.py with syntax error #133488

IzumiSy opened this issue Jun 13, 2023 · 2 comments · Fixed by #133490
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@IzumiSy
Copy link
Contributor

IzumiSy commented Jun 13, 2023

brew gist-logs <formula> link OR brew config AND brew doctor output

brew config

HOMEBREW_VERSION: 4.0.22
ORIGIN: https://github.com/Homebrew/brew
HEAD: 9d01e1deafca35f30b709b5f6a031faaff9642ec
Last commit: 21 hours ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 480317f32d9a2908002451092ac49b0d001541cd
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/Homebrew
HOMEBREW_REPOSITORY: /opt/Homebrew
HOMEBREW_CELLAR: /opt/Homebrew/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_INSTALL_FROM_API: set
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.3 build 1403
Git: 2.41.0 => /opt/Homebrew/bin/git
Curl: 7.88.1 => /usr/bin/curl
macOS: 13.4-arm64
CLT: 14.3.1.0.1.1683849156
Xcode: N/A
Rosetta 2: false

brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Your Homebrew's prefix is not /opt/homebrew.

Many of Homebrew's bottles (binary packages) can only be used with the default prefix.
Consider uninstalling Homebrew and reinstalling into the default prefix.
It is expected behaviour that some formulae will fail to build in this unsupported configuration.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

Verification

  • My "brew doctor output" says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Running python3 says NameError: name 'new_prefix' is not defined

$ python3
Error in sitecustomize; set PYTHONVERBOSE for traceback:
NameError: name 'new_prefix' is not defined
Python 3.11.4 (main, Jun 13 2023, 08:01:26) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

What happened (include all command output)?

Checking if python3 is installed by homebrew

$ brew install python3
Warning: python@3.11 3.11.4 is already installed and up-to-date.
To reinstall 3.11.4, run:
  brew reinstall python@3.11

Install path

$ which python3
/opt/Homebrew/bin/python3

What did you expect to happen?

No error when runnnig python3.

Step-by-step reproduction instructions (by running brew commands)

$ python3
Error in sitecustomize; set PYTHONVERBOSE for traceback:
NameError: name 'new_prefix' is not defined
Python 3.11.4 (main, Jun 13 2023, 08:01:26) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
@IzumiSy IzumiSy added the bug Reproducible Homebrew/homebrew-core bug label Jun 13, 2023
@IzumiSy
Copy link
Contributor Author

IzumiSy commented Jun 13, 2023

I already know that the sitecustomize method generates error-containing Python script.

See the PR that I have opened to fix this issue.

@IzumiSy IzumiSy changed the title Install python3 creates sitecustomze.py with syntax error Install python3 creates sitecustomize.py with syntax error Jun 13, 2023
@carlocab
Copy link
Member

Closing since there is already an open pull request at #133490.

@github-actions github-actions bot added the outdated PR was locked due to age label Jul 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants