简体   繁体   English

/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 和 /usr/local/bin/python3 中的 Python 有什么区别

[英]What is the difference between Python in /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 and in /usr/local/bin/python3

VS 代码解释器路径

I recently formatted my Macbook and I only remember downloading Python3 once.我最近格式化了我的 Macbook,我只记得下载过一次 Python3。 So when I went to change my interpreter path, it shows 2 different Python3 paths.所以当我去改变我的解释器路径时,它显示了 2 个不同的 Python3 路径。 I'm aware that the one on top is installed on my system by default, but as for the bottom two, I'm not too sure what are the differences between them.我知道顶部的那个默认安装在我的系统上,但至于底部的两个,我不太确定它们之间有什么区别。

The 1st one (Python2.7) is the system default/built-in Python.第一个(Python2.7)是系统默认/内置Python。

The middle one (Python3, /Library/Frameworks/Python.framework/ ) is what you usually get when you install Python from the Python Releases for Mac OS X downloads page from python.org, using the macOS installer (something like a python-3.8.7-macosx10.9-1.pkg ). The middle one (Python3, /Library/Frameworks/Python.framework/ ) is what you usually get when you install Python from the Python Releases for Mac OS X downloads page from python.org, using the macOS installer (something like a python-3.8.7-macosx10.9-1.pkg )。

The bottom one (Python3, /usr/local/bin/python3 ) is what you usually get when you use Homebrew to install Python: https://docs.brew.sh/Homebrew-and-Python .底部的(Python3, /usr/local/bin/python3 )是您使用 Homebrew 安装 Python 时通常得到的: https://docs.brew.sh/Homebrew-and-Python

~$ brew info python3
python@3.9: stable 3.9.1 (bottled)
...
Python has been installed as
  /usr/local/bin/python3
...
You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.9/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

There is no difference in terms of functionality between the python.org one and the Homebrew one. python.org 和 Homebrew 之间的功能没有区别。 If you installed the same version, they should work the same.如果您安装了相同的版本,它们的工作方式应该相同。 The only difference, aside from the paths, is when you need to upgrade and/or remove your installation (ex. going from python3.8 to python3.9), something easily done with Homebrew using brew upgrade python3 and brew uninstall python3 .除了路径之外,唯一的区别是当您需要升级和/或删除您的安装(例如从 python3.8 到 python3.9)时,使用 Homebrew 使用brew upgrade python3brew uninstall python3可以轻松完成。

As to why VS Code finds those Python interpreters, see the section on the VS Code docs for where the extension looks for environments , which lists among those " Standard install paths such as /usr/local/bin , /usr/sbin , /sbin , c:\\python27 , c:\\python36 , etc ".至于为什么 VS Code 会找到那些 Python 解释器,请参阅 VS Code 文档中有关扩展查找环境的部分,其中列出了“标准安装路径,例如/usr/local/bin/usr/sbin/sbin , c:\\python27 \\python27 , c:\\python36"。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 osx-/ usr / bin / python和/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7有什么区别? - osx - What's the difference between /usr/bin/python and /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7? dyld:库未加载:/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python - dyld: Library not loaded: /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Python Python给出的Python OSX $ /Library/Frameworks/Python.framework/Versions/2.7/bin/python - Python OSX $ which Python gives /Library/Frameworks/Python.framework/Versions/2.7/bin/python 与 /usr/bin/python3.4 /usr/bin/python3 的区别 - Difference with /usr/bin/python3.4 /usr/bin/python3 -bash:/Library/Frameworks/Python.framework/Versions/3.6/bin/pip:没有这样的文件或目录 - -bash: /Library/Frameworks/Python.framework/Versions/3.6/bin/pip: No such file or directory 如何告诉 bash 使用 /usr/local/bin/python3 而不是 /usr/bin/python3? - How do I tell bash to use /usr/local/bin/python3 instead of /usr/bin/python3? 为什么我的默认 PATH 中有一些 /Library/Frameworks/Python.framework/Versions/XX/bin? - Why do I have some /Library/Frameworks/Python.framework/Versions/X.X/bin in my default PATH? 无法连接到python3中的Service /usr/local/bin/geckodriver - Can not connect to the Service /usr/local/bin/geckodriver in python3 #!/usr/bin/python3 shebang 的目的 - Purpose of #!/usr/bin/python3 shebang 在 Jupyter 笔记本中使用 /usr/bin/python3 - Use /usr/bin/python3 in Jupyter notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM