以在遠程主機上安裝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.
>>>