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?
解决方案
Create a new Python 3 environment by running:
conda create --name python3 python=3
If you want all the standard anaconda packages installed by default, do:
conda create --name python3 python=3 anaconda
Whenever you need to use python3 run:
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.
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.
在已经安装了Python2.7作为默认环境的情况下,需要为Python3.6安装'statistics'包。可以通过创建新的Python3环境来实现。首先使用conda创建一个名为python3的新环境,然后激活该环境并使用命令行进行常规操作。要安装包,务必先激活python3环境。注意Python3自身已包含'statistics'模块,如果需要在Python2中使用,也有相应移植方案。
1500

被折叠的 条评论
为什么被折叠?



