How do I install a package for different Python versions in Anaconda?(如何在 Anaconda 中为不同的 Python 版本安装包?)
问题描述
我有 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 版本安装包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Anaconda 中为不同的 Python 版本安装包?
- 如何将一个类的函数分成多个文件? 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 沿轴计算直方图 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
