我有 Python 2.7 作为 root.我需要在 Python 3.6 中安装包statistics",它不在 anaconda navigator 的环境中.如何使用 conda 或 pip 为辅助 Python 环境安装statistics"?
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 时运行:
Whenever you need to use python3 run:
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 版本安装包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 python 解析非常大的 xml 文件时出现问题Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件时出现问题)
使用 Python 2 在 XML 中按属性查找所有节点Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按属性查找所有节点)
Python - 如何解析 xml 响应并将元素值存储在变量中Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 响应并将元素值存储在变量中?)
如何在 Python 中获取 XML 标记值How to get XML tag value in Python(如何在 Python 中获取 XML 标记值)
如何使用 ElementTree 正确解析 utf-8 xml?How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正确解析 utf-8 xml?)
将 XML 从 URL 解析为 python 对象Parse XML from URL into python object(将 XML 从 URL 解析为 python 对象)