gpt4 book ai didi

python - 为什么我不能使用 python 虽然它告诉我 python3 已经是最新版本 (3.5.1-3)

转载 作者:太空宇宙 更新时间:2023-11-04 00:24:53 24 4
gpt4 key购买 nike

我想在我的 ubuntu 中使用 python。当我使用 python 命令时,它告诉我:

dc2-user@10-254-6-144:~$ python
The program 'python' can be found in the following packages:
* python-minimal
* python3
Ask your administrator to install one of them

然后我尝试安装它:

dc2-user@10-254-6-144:~$ sudo apt-get install python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.5.1-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

但是如你所见,我好像已经安装了python3.5然后我卸载它并安装它,通过

sudo apt-get remove python3.5
sudo apt-get install python3.5

但仍然无法使用 python 命令。
一般情况下,我可以在安装后使用python命令。我不知道发生了什么,下一步应该做什么?

最佳答案

Ubuntu 只安装 Python 3,不会添加从 /usr/bin/python3/usr/bin/python 的链接

所以你被迫:

  • 使用python3

  • 自己添加链接或别名或其他基于 shell 的解决方案

引用:

引用:

  • Python 3 will be the only Python version installed by default.
  • Python 3 will be the only Python version in any installation media (i.e. image ISOs)
  • Only Python 3 will be allowed on the Ubuntu touch images.
  • All upstream libraries that support Python 3 will have their Python 3 version available in the archive.
  • All applications that run under Python 3 will use Python 3 by default.
  • All system scripts in the archive will use Python 3.

  • /usr/bin/python will point to Python 3. No, this is not going to happen (unless PEP 394 advocates otherwise, which is doubtful for the foreseeable future). /usr/bin/python and /usr/bin/python2 will point to Python 2.7 and /usr/bin/python3 will point to the latest supported Python 3 version.

关于python - 为什么我不能使用 python 虽然它告诉我 python3 已经是最新版本 (3.5.1-3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47882307/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com