English
English
Appearance
INFO
This article was auto-translated using ChatGPT.
When using Python3 installed via brew, I constantly saw the annoying warning đđģ below when installing libraries with pip3 đ: 
After a quick glance at the suggested issue, I found the following two fix methods:
Continue using Python versions below 3.10, which requires modifying the pip source code as follows: Code to be removed
deprecated(
reason=(
"Configuring installation scheme with distutils config files "
"is deprecated and will no longer work in the near future. If you "
"are using a Homebrew or Linuxbrew Python, please see discussion "
"at https://github.com/Homebrew/homebrew-core/issues/76621"
),
replacement=None,
gone_in=None,
)You only need to delete the above code from the corresponding local file. This method only suppresses âī¸ the warning output and does not address the root cause.
Switch the brew Python version to 3.10 or above. Assuming you have 3.9 and 3.10 locally, other scenarios are similar:
brew unlink python@3.9
brew unlink python@3.10
brew link -overwrite python@3.10
# It might prompt you to add the corresponding path to your environment; just follow the instructions
fish_add_path /opt/homebrew/opt/python@3.10/binAfter completing the above operations, you can switch đ the default Python version for brew! Let's try installing âŦī¸ rich:
Excellent đđģ, no warnings đ!