如何在Anaconda中为不同的Python版本安装软件包?

编程入门 行业动态 更新时间:2024-10-21 13:23:19
本文介绍了如何在Anaconda中为不同的Python版本安装软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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版本安装软件包?

本文发布于:2023-07-05 06:56:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034397.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:软件包   中为   版本   如何在   Anaconda

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!