如何在Anaconda中为不同的Python版本安装软件包? [英] How do I install a package for different Python versions in Anaconda?

查看:261
本文介绍了如何在Anaconda中为不同的Python版本安装软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以Python 2.7为根.我需要在Python 3.6中安装软件包"statistics",并且它不在anaconda navigator的环境中.对于辅助Python环境,如何使用condapip安装统计信息"?

I have Python 2.7 as root. I need to install the package "statistics" in Python 3.6, and it is not in the environments of anaconda navigator. How can install "statistics" with conda or pip for a secondary Python environment?

推荐答案

通过运行以下命令创建新的Python 3环境:

Create a new Python 3 environment by running:

conda create --name python3 python=3

如果要默认安装所有标准anaconda软件包,请执行以下操作:

If you want all the standard anaconda packages installed by default, do:

conda create --name python3 python=3 anaconda

每当需要使用python3时运行:

activate python3

然后照常使用命令行.因此,如果要在python3环境中安装某些软件,请确保先activate python3.

Then use the command line as normal. So, if you want to install something into your python3 environment, make sure you activate python3 first.

请注意,python 3 具有自己的统计模块,您可能会发现它有用,并且如果您愿意,该模块已移植到python 2 .

Note that python 3 has it's own statistics module that you may find useful, and this module has been ported to python 2 if you would prefer.

这篇关于如何在Anaconda中为不同的Python版本安装软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆