Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Brew升级python返回“;“未安装python”;_Python_Python 3.x_Macos_Homebrew - Fatal编程技术网

Brew升级python返回“;“未安装python”;

Brew升级python返回“;“未安装python”;,python,python-3.x,macos,homebrew,Python,Python 3.x,Macos,Homebrew,我正在尝试使用$brew upgrade Python从“Python 3.7.3”升级到“Python 3.8”。但当我尝试时,brew返回: Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae Updated 2 formulae. Error: python not installed 我知道python已经安装了,因为我已经使

我正在尝试使用
$brew upgrade Python
从“Python 3.7.3”升级到“Python 3.8”。但当我尝试时,brew返回:

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 2 formulae.

Error: python not installed
我知道python已经安装了,因为我已经使用它好几个月了。我可以通过运行,
which python3

/usr/bin/python3
python3--version

Python 3.7.3
我不知道是什么原因造成的

问题可能是
python--version
仍然指向python2,
python2.7.16


更新 我还确认我已经运行了
brew cleanup
brew doctor

brew信息python
返回

python@3.8: stable 3.8.5 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python@3.8.rb
License: Python-2.0
==> Dependencies
Build: pkg-config ✔
Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python@3.8/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.8/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 587,815 (30 days), 1,615,984 (90 days), 2,710,078 (365 days)
install-on-request: 187,760 (30 days), 307,168 (90 days), 343,355 (365 days)
build-error: 0 (30 days)

python@3.8:稳定3.8.5(瓶装)
解释的、交互式的、面向对象的编程语言
https://www.python.org/
未安装
发件人:https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python@3.8.rb
许可证:Python-2.0
==>依赖项
构建:pkg配置✔
必填项:gdbm✔, openssl@1.1 ✔, 阅读线✔, sqlite✔, xz✔
==>注意事项
Python已安装为
/usr/local/bin/python3
未版本的符号链接`python`、`python config`、`pip`等,指向
`python3`、`python3 config`、`pip3`等已分别安装到
/usr/本地/opt/python@3.8/libexec/bin
您可以使用安装Python包
pip3安装
它们将安装到站点包目录中
/usr/local/lib/python3.8/site-packages
见:https://docs.brew.sh/Homebrew-and-Python
==>分析
安装:587815(30天)、1615984(90天)、2710078(365天)
按要求安装:187760(30天)、307168(90天)、343355(365天)
生成错误:0(30天)

解决方案是使用brew安装python

brew install python
我以为它已经安装好了,但那是系统(不是brew)版本


错误,
error:python not installed
意味着python没有与brew一起安装。

python not installed
意味着python不是由自制软件安装的。
brew info python
有什么要说的?@khelwood这是一台相当新的mac电脑,我想我只使用了自制软件。我想可能是我不小心安装了它…@MisterMiyagi我添加了上面
brew info python
返回的内容。TBH,这超出了我的理解。重要的部分是
未安装
行。请在尝试升级之前安装它。非常好-谢谢
brew install python