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

标签 python

我想在我的 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/

相关文章:

python - 使用模板构造md5哈希算法

python - 从 Python 写入 Bigtable

python - Json 字符串解析在从 MSDOS 运行时有效,但在 Windows 上的 Ubuntu 上的 Bash 中无效

python - 如何解决 Python "WindowsError messages are not properly encoded"问题?

python - 如何处理从 python 函数返回的空(无)元组

python - 如何按索引重命名 PySpark 数据框列? (处理重复的列名)

python - 识别 Pandas 数据框中的重复项

python - 为 3D 软件部署 Python 模块

python - 如何从 python 中的二维列表中获取所有可能的项目组合?

python - 在 Python 中使用 forever.js