简体   繁体   English

Ubuntu 14.04软件包依赖项问题

[英]Ubuntu 14.04 package dependency issue

Host: Ubuntu 14.04 主持人:Ubuntu 14.04

When I executed a script, I got the following issue: 执行脚本时,出现以下问题:

The following packages have unmet dependencies:
dh-python : Depends: python3:any (>= 3.3.2-2~)
lsb-release : Depends: python3 but it is not going to be installed

Depends: python3:any (>= 3.3.2-2~)
ubuntu-minimal : Depends: python3 but it is not going to be installed
              Depends: resolvconf

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I have entered apt-get -f install and executed the script again. 我输入了apt-get -f install并再次执行了脚本。 However, it did not make any change. 但是,它没有进行任何更改。

The python version on my system is: 我系统上的python版本是:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)

Python 3 is the key here. Python 3是这里的关键。 You are using Python 2. 您正在使用Python 2。

So, I highly recommend using Anaconda for your purposes. 因此,我强烈建议您使用Anaconda。 It will allow you to switch between Python2 and Python3 它将允许您在Py​​thon2和Python3之间切换

In your browser download the Anaconda installer for Linux , then in your terminal window type the following, replacing the file path and name with the path and name of your downloaded install file. 在浏览器中,下载用于LinuxAnaconda安装程序 ,然后在终端窗口中键入以下内容,将文件路径和名称替换为下载的安装文件的路径和名称。 (There is also a gui installer that sets up a PATH entry) (还有一个gui安装程序可以设置PATH条目)

Follow the prompts on the installer screens, and if unsure about any setting, simply accept the defaults, as they can all be changed later: 按照安装程序屏幕上的提示进行操作,如果不确定任何设置,只需接受默认值即可,因为以后都可以更改它们:

bash ~/Downloads/Anaconda-2.3.0-Linux-x86_64.sh

Now add conda to your path 现在将conda添加到您的路径中

PATH=$PATH:$HOME/anaconda/bin

*replace the path with the correct path to anaconda/bin wherever it lives on your machine *使用正确的路径将路径替换为anaconda/bin所在的计算机上的路径

Now create an environment that uses python3 现在创建一个使用python3的环境

conda create --name test python=3

Activate your environment 激活你的环境

source activate test

You will see an environment (test) in front of your command prompt. 您将在命令提示符前看到一个环境(test) Test can be renamed to suit your needs. 可以根据需要重命名测试。

Verify: 校验:

python --version

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

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