简体   繁体   中英

MacOS Catalina comes with Python 3.7.3, need to upgrade

I recently upgraded to macOS Catalina and it seems to come with Python 3.7.3. All of my packages have come from the PIP installed with Python 3.7.3.

I have installed Python 3.7.7 (the newest version available on Homebrew), but it gives an error when linking. It tells me to run brew link python3 , and when I do, it says

Linking /usr/local/Cellar/python/3.7.7... 
Error: Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'
To force the link and overwrite all conflicting files:
  brew link --overwrite python
To list all files that would be deleted:
  brew link --overwrite --dry-run python

Previously, I accidentally uninstalled Python 3.7.3, which many people have recommended against because it is not a good idea to uninstall the macOS bundled Python and may cause issues with the operating system. I had lost all of the packages installed using PIP, and I had to restore my computer using my Time Machine backup to avoid issues with my operating system.

How can I make the newest version of Python (3.7.7) the default, and "transfer" my packages from PIP into the newest version of Python (if that is even required) and fix my Python installation?

Xcode 附带了 3.7.3 的 Python 安装,所以我所要做的就是删除应用程序 Xcode,然后我使用 Brew 运行了全新的 Python 安装。

yes you are right. New MacOs built in python3.7.3 in system and it comes from xcode, u dont't have to uninstall xcode

all you need to do is remove /lib/commandlinetools/freamwork/python3.7.3 .

and install newest python with brew.

run python3 --version and pip3 --version they all newest from brew

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM