1.先去conda的官网下载继续需要的版本到本地:
2.使用上传软件,winscp或者其他的,我使用的是mobaxterm
3.确保脚本具有执行权限:
chmod +x Anaconda3-2024.02-1-Linux-s390x.sh
4.运行安装脚本,就是上面下载的文件:
./Anaconda3-2024.02-1-Linux-s390x.sh
5.然后一直yes,enter
6.设置环境变量:profile和.bashrc
首先:
vim /etc/profile
在末尾添加环境变量:
export PATH=~/anaconda3/bin:$PATH
然后:
vim ~/.bashrc
在末尾添加环境变量:
export PATH=~/anaconda3/bin:$PATH
7.刷新上面的配置文件:
source /etc/profile
source ~/.bashrc
8.如果不能 刷新成功 直接关掉那个窗口,重新开一个窗口就行了。
9.报错:
当你激活自己的运行环境时
conda activate finetuning
错误信息:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. If your shell is Bash or a Bourne variant, enable conda for the current user with $ echo ". /root/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc or, for all users, enable conda with $ sudo ln -s /root/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh The options above will permanently enable the 'conda' command, but they do NOT put conda's base (root) environment on PATH. To do so, run $ conda activate in your terminal, or to put the base environment on PATH permanently, run $ echo "conda activate" >> ~/.bashrc Previous to conda 4.4, the recommended way to activate conda was to modify PATH in your ~/.bashrc file. You should manually remove the line that looks like export PATH="/root/anaconda3/bin:$PATH" ^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^
按照报错的提示信息,进行如下操作:
sudo ln -s /root/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh
conda activate
echo "conda activate" >> ~/.bashrc
vim ~/.bashrc
手动移除类似于以下的行:export PATH="/root/anaconda3/bin:$PATH"
重新刷新 :
source ~/.bashrc
如果不能重新刷新直接就关闭这个窗口,重新开启一个窗口。
10.附加信息,conda创建一个虚拟环境操作
conda create -n 名字 python==3.8