简体   繁体   English

Python 3.8.5 安装在 MacOS 上,但 python --version 返回 2.7.16 -- 我该如何解决这个问题?

[英]Python 3.8.5 installed on MacOS but python --version returns 2.7.16 -- How do I fix this?

The following is what I see in my terminal (MacOS).以下是我在终端 (MacOS) 中看到的内容。 I've installed python and it tells me that 3.8.5 is already installed, but when I ask the terminal what version I have, it gives me something different.我已经安装了 python,它告诉我已经安装了 3.8.5,但是当我询问终端我有什么版本时,它给了我一些不同的东西。 How do I fix this?我该如何解决? Or what am I doing wrong?或者我做错了什么?

Warning: python@3.8 3.8.5 is already installed and up-to-date
To reinstall 3.8.5, run `brew reinstall python@3.8`
user ~ % python --version   
Python 2.7.16
user ~ % 

Try using python3 --version .尝试使用python3 --version It will return the answer you are expecting.它将返回您期望的答案。

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

相关问题 无法从终端 window 运行 Python 程序,我该如何解决? (Windows 10、Python 版本 3.8.5) - Can't run Python programs from the terminal window, how do I fix this? (Windows 10, Python version 3.8.5) 如何在 macOS Catalina 版本 10.15.7 上卸载 Python 2.7.16 或如何切换到 Python 3.9.2? - How to uninstall Python 2.7.16 on a macOS Catalina Version 10.15.7 or how to switch to Python 3.9.2? 当安装程序不起作用时,如何正确卸载/修复 python 3.8.5? - How do I properly uninstall/fix python 3.8.5 when the installer doesn't work? 终端输出:Python 2.7.16 即使我安装了 3.8.2 - Terminal outputting: Python 2.7.16 Even though I have 3.8.2 installed 我如何在 Windows 10 上为 python 3.8.5 安装 pyaudio - how do i install pyaudio on windows ten for python 3.8.5 如何将 python 2.7.16 更换为 python 3? - How to replace python 2.7.16 to python 3? 如何将旧的python 2.7.x版本升级到2.7.16? - How to upgrade older python 2.7.x version to 2.7.16? 如何修复 python 3.8.5。 错误“导入错误:无法从‘io’(未知位置)导入名称‘open_code’” - How do I fix python 3.8.5. error "ImportError: cannot import name 'open_code' from 'io' (unknown location)" Vscode 显示 Python 2.7.16 ... 我如何更改为 3.8? - Vscode shown Python 2.7.16... How can I change to 3.8? 如何在MacOS上将Python 3.5作为我的默认版本? - How do I make Python 3.5 my default version on MacOS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM