【Python学习】miniconda安装多个Python版本

以在远程主机上安装Python3.6环境为例

下载miniconda:

下载链接

传送到远程主机:

$ scp -r X zhaowanru@主机ip:~/Y # X是本地文件夹,Y是远程主机上的文件夹
$ Password: (输入密码)

安装miniconda:

$ sh Miniconda3-latest-Linux-x86_64.sh

一路ENTER或者yes

激活conda:

Thank you for installing Miniconda3!
$ conda
conda: command not found
$ source /home/SENSETIME/zhaowanru/miniconda3/bin/activate # 该路径在安装时可找到
(base) $ conda create -n env36 python=3.6 # env36为要创建的环境的名字
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

'https://repo.anaconda.com/pkgs/main/linux-64'

# 打开该链接,重新输入命令即可自动连接:
(base) $ conda create -n env36 python=3.6
Collecting package metadata (current_repodata.json): done
Solving environment: done
# 会自动下载本地没有的Python版本
# To activate this environment, use
#
#     $ conda activate env36
#
# To deactivate an active environment, use
#
#     $ conda deactivate

进入Python3.6环境:

(base) $ conda activate env36
(env36) $ python
Python 3.6.10 |Anaconda, Inc.| (default, May  8 2020, 02:54:21)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

大功告成!

posted @ 2020-07-06 08:56  Ryan0v0  阅读(1587)  评论(0编辑  收藏  举报