我正在Ubuntu16.04上安装Python2.7。当我键入python、python2或python2.7时,我会得到以下消息:
The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install <selected package>运行sudo apt install python2.7后,我得到以下消息,但输入python时,python仍然不可用。
Reading package lists... Done Building dependency tree Reading state
information... Done You might want to run 'apt-get -f install' to
correct these: The following packages have unmet dependencies:
mongodb-compass : Depends: gvfs-bin
Depends: python but it is not going to be installed
python2.7 : Depends: python2.7-minimal (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).我也试过:
sudo apt install pythonsudo apt install python2.7sudo apt install python2sudo apt-get install pythonsudo apt-get install python 2.7sudo apt-get install python2到目前为止,什么都没有起作用。
我只需输入python3就可以访问Python3.5,但我需要python2.7。在尝试安装python之前,我更新了存储库。我做错了什么?
运行python的缓存策略:
python2.7:
Installed: (none)
Candidate: 2.7.12-1ubuntu0~16.04.3
Version table:
2.7.12-1ubuntu0~16.04.3 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
2.7.12-1ubuntu0~16.04.2 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
2.7.11-7ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages运行mongodb的缓存策略:
mongodb-compass:
Installed: 1.6.0-1
Candidate: 1.6.0-1
Version table:
*** 1.6.0-1 100
100 /var/lib/dpkg/status发布于 2018-02-01 21:50:10
尝试删除mongodb-compass
sudo apt-get purge mongodb-compass然后检查所有的东西是否都在
sudo apt-get install -f
sudo apt-get check发布于 2018-05-29 08:03:20
尝试这个简单的命令并安装python2.7,谢谢
sudo apt安装python-最小
并检查您将获得2.7.X版本的版本(python -V)。
https://askubuntu.com/questions/1002190
复制相似问题