Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Ubuntu 14.04包依赖性问题_Python_Ubuntu - Fatal编程技术网

Python Ubuntu 14.04包依赖性问题

Python Ubuntu 14.04包依赖性问题,python,ubuntu,Python,Ubuntu,主机:Ubuntu 14.04 当我执行脚本时,我遇到了以下问题: 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-minim

主机:Ubuntu 14.04

当我执行脚本时,我遇到了以下问题:

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).
我已经输入了
apt get-f install
并再次执行了脚本。然而,它没有作出任何改变

我的系统上的python版本是:

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

Python3是这里的关键。您正在使用Python2

因此,我强烈建议您使用水蟒。它将允许您在Python2和Python3之间切换

在浏览器中下载,然后在终端窗口中键入以下内容,将文件路径和名称替换为下载的安装文件的路径和名称。(还有一个gui安装程序,用于设置路径条目)

按照安装程序屏幕上的提示进行操作,如果不确定任何设置,只需接受默认设置,因为它们都可以在以后更改:

bash ~/Downloads/Anaconda-2.3.0-Linux-x86_64.sh
现在将
conda
添加到您的路径中

PATH=$PATH:$HOME/anaconda/bin
*将路径替换为anaconda/bin的正确路径,无论它位于计算机上的何处

现在创建一个使用python3的环境

conda create --name test python=3
激活您的环境

source activate test
您将在命令提示符前看到一个环境
(test)
。可以重命名测试以满足您的需要

核实:

python --version

你需要使用python3try
python3你的文件.py
Ubuntu 14.04也附带了python3。这是否意味着我应该将默认的python版本切换到3而不是2?如果是的话,你能告诉我如何改变它吗。像迈克尔那样的感谢者:)