在Linux中将包添加到Python的特定安装中

时间:2017-05-29 11:34:23

标签: python linux apt-get xmltodict

我正在尝试在Linux上向Python添加xmltodict包。

我在Linux版本上安装了2个Python; Python 2.7(默认)和Python 3.5(以Anaconda安装的形式)。我想将xmltodict添加到Python 3安装中,但是当我使用sudo apt-get install python-xmltodict时,它会将其添加到默认的Python 2.7安装中。

如何在不更改默认值或使用pip的情况下将此软件包添加到我的Python 3安装中?我不想用虚拟环境重建我的安装

2 个答案:

答案 0 :(得分:1)

如果你想用pip或easy-install来做,你可以运行pip2 / pip2.7并安装它。它将安装用于运行pip的Python ...

答案 1 :(得分:0)

您可以使用conda进行安装

conda install -c conda-forge xmltodict=0.11.0

这应该有效

相关问题