进入 https://repo.anaconda.com/archive/ 查看要安装的版本,如:
下载wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh
安装bash Anaconda3-2021.11-Linux-x86_64.sh
安装位置
/root/anaconda3/bin/conda
sudo vi /etc/profile
添加
export PATH=/root/anaconda3/bin:$PATH
source /etc/profile
conda -V
conda create -n pt python==3.8
配置环境conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
附:可以再安装一些常用的库
pip install numpy
pip install pandas
pip install scikit-learn
pip install matplotlib
pip install jupyter
生成配置文件jupyter notebook --generate-config
设置远程密码(base) user@SYS:~$ ipython
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
Type ‘copyright’, ‘credits’ or ‘license’ for more information
IPython 7.29.0 – An enhanced Interactive Python. Type ‘?’ for help.
In [1]: from notebook.auth import passwd
In [2]: passwd(algorithm=‘sha1’) ## 12345678 生成密码!!!: sha1:6943bfa21d18:1c50xxxxxxxxxx7b72bca80678ed8a66b49bfcc
Enter password:
Verify password:
Out[2]: ‘sha1:*****’
In [3]: exit()
设置jupyter notebook
vim /home/user/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = ‘*’
c.NotebookApp.password = u’前边的密钥’
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.allow_remote_access = True
c.NotebookApp.allow_root = True



