Python 3.7.3意外安装在Mac OS 10.15.1上-包含在Xcode Developer Tools 11.2中吗? [英] Python 3.7.3 Inadvertently Installed on Mac OS 10.15.1 - Included in Xcode Developer Tools 11.2 Now?

查看:104
本文介绍了Python 3.7.3意外安装在Mac OS 10.15.1上-包含在Xcode Developer Tools 11.2中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天决定进行全新安装Mac OS(例如,擦除我的整个磁盘并重新安装OS).

I decided yesterday to do a clean install of Mac OS (as in, erase my entire disk and reinstall the OS).

我正在使用Macbook Air2018.我全新安装了Mac OS 10.15.1. 由于我以前的Python环境非常混乱,因此我进行了全新安装. 我希望我能掌握一切并正确安装.

I am on a Macbook Air 2018. I did a clean install of Mac OS 10.15.1. I did this clean install due my previous Python environment being very messy. It was my hope that I could get everything reigned in and installed properly.

我已经开始重新安装旧的应用程序,并小心确保没有在怪异的位置安装任何东西.

I've started reinstalling my old applications, and took care to make sure nothing was installed in a weird location.

但是,当我开始设置VS Code时,我注意到我的Python解释器选项显示4个选项.它们如下:

However, when I started setting up VS Code, I noticed that my options for Python interpreters showed 4 options. They are as follows:

  • 位于/usr/bin/python
  • 中的Python 2.7.16 64位
  • 位于
  • 中的Python 2.7.16 64位
  • 位于/user/bin/python
  • 中的Python 3.7.3 64位
  • 位于/Library/Developer/CommandLineTools/usr/bin/python3
  • 中的Python 3.7.3 64位
  • Python 2.7.16 64-bit, located in /usr/bin/python
  • Python 2.7.16 64-bit, located in /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
  • Python 3.7.3 64-bit, located in /user/bin/python
  • Python 3.7.3 64-bit, located in /Library/Developer/CommandLineTools/usr/bin/python3

在终端中,如果我输入where python python3 它返回 /usr/bin/python /usr/bin/python3.

In terminal, if I enter where python python3 it returns /usr/bin/python /usr/bin/python3.

python3如何到达那里?

How in the world did python3 get there?

我唯一的想法是,它现在已包含在Xcode Developer Tools 11.2软件包中,因为我确实安装了该软件包.我找不到包含此内容的任何文档.

My only idea is that it now is included in the Xcode Developer Tools 11.2 package, as I did install that. I cannot find any documentation of this inclusion.

任何想法如何到达这里?更重要的是,如何删除它?我想使用Homebrew来满足所有安装需求.另外,为什么VS Code显示4个选项?

Any ideas how this got here? More importantly, how do I remove it? I want to use Homebrew for all of my installation needs. Also, why does VS Code show 4 options?

谢谢!

推荐答案

运行python 2.7环境的命令行工具位于/usr/bin/python,但其框架和依赖项位于/System.这包括Python.app捆绑包,该捆绑包只是需要使用Mac的UI环境运行的脚本的包装. 尽管这些文件是单独的可执行文件,但它们可能指向相同的环境.

The command line tool to run the python 2.7 environment is at /usr/bin/python, but the framework and dependencies for it are in /System. This includes the Python.app bundle, which is just a wrapper for scripts that need to run using the Mac's UI environment. Although these files are separate executables, it's likely that they point to the same environment.

每个MacOS都有这些.

Every MacOS has these.

默认情况下,Catalina确实也包含/usr/bin/python3.第一次运行它时,操作系统将要下载Xcode或命令行工具来安装完整的" python3.所以这些对也是相同的环境.

Catalina does indeed also include /usr/bin/python3 by default. The first time you run it, the OS will want to download Xcode or the Command line tools to install the 'complete' python3. So these pair are also the same environment.

由于Catalina中系统文件的安全性限制,我认为您无法轻松删除这些文件.

I don't think you can easily remove these, due to the security restrictions on system files in Catalina.

有趣的是,Big Sur仍然带有python2!

Interestingly, Big Sur still comes with python2 !

这篇关于Python 3.7.3意外安装在Mac OS 10.15.1上-包含在Xcode Developer Tools 11.2中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆