简体   繁体   English

在 ubuntu 18.04 上安装 python 2.7

[英]Install python 2.7 on ubuntu 18.04

is there a way to install Python 2.7 on Ubuntu 18.04?有没有办法在 Ubuntu 18.04 上安装 Python 2.7? I tried this command but it isn't working.我试过这个命令,但它不起作用。

sudo apt install python-minimal

Is there a way to install it manually?有没有办法手动安装? I try python 2.7 for a software that didn't support python 3.我为不支持 python 3 的软件尝试了 python 2.7。

Thanks!谢谢!

Run these commands to ensure your repositories are up to date before installing在安装之前运行这些命令以确保您的存储库是最新的

sudo apt update
sudo apt upgrade
sudo apt install python2.7

Then to install pip for python 2:然后为python 2安装pip:

sudo apt install python-pip

As my comment has solved the issue, I will develop it a little more in this answer for further reference.由于我的评论已解决了该问题,因此我将在此答案中对其进行更多开发以供进一步参考。

Try using aptitude, it better manage conflicting packages for you:尝试使用 aptitude,它可以更好地为您管理冲突的包:

sudo aptitude install python-minimal

Reference: https://askubuntu.com/a/451078/1006720参考: https : //askubuntu.com/a/451078/1006720

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM