首页 > 解决方案 > Babun 显示旧版本的 Python

问题描述

我正在尝试使用 Babun 检查当前版本的 Python(3.7.0)。但是,它显示的是旧版本(2.7.8)。使用 Windows 命令提示符时我没有遇到问题。

Windows 命令提示符

Microsoft Windows [Version 10.0.17134.228]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\Gauranga Das>python --version
Python 3.7.0

C:\Users\Gauranga Das>

巴本

LAPTOP-298AIKEQ% python --version
Python 2.7.8
LAPTOP-298AIKEQ%

标签: pythonpython-3.xpython-2.7babun

解决方案


在 babun shell 中运行:

pact install python3

然后在 babun 文件夹中运行 update.bat,它将重新安装 cywin。(无法从 babun shell 内部运行 update.bat,因为需要关闭所有 babun shell 才能重新安装):

update.bat

现在我们可以通过运行查看 python 3 版本:

python3 --version

推荐阅读