#下载安装脚本
wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh --no-check-certificate
#执行安装
bash Anaconda3-2022.05-Linux-x86_64.sh
#查看用户执行环境
cat ~/.bashrc
...
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/etc/profile.d/conda.sh" ]; then
. "/usr/etc/profile.d/conda.sh"
else
export PATH="/usr/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
#加载conda 用户环境
source ~/.bashrc
#关闭终端自动进入base环境
conda config --set auto_activate_base false
#配置源
conda config --remove channels https://repo.anaconda.com/pkgs/main/linux-64
conda config --remove channels https://repo.anaconda.com/pkgs/main/noarch
conda config --remove channels https://repo.anaconda.com/pkgs/main/linux-64
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
#安装依赖模块
#virtual(mytest) root@10--1xxx:/home/zhangsan/virtualenv# conda install selenium
(mytest) root@10-1xxx:/home/zhangsan/virtualenv# conda install requests
(mytest) root@10-1xxx:/home/zhangsan/virtualenv# conda install xlrd
(mytest) root@10-1xxx:/home/zhangsan/virtualenv# conda uninstall xlrd
(mytest) root@10-1xxx:/home/zhangsan/virtualenv# conda install xlrd==1.2.0
#内部无法安装,则可尝试在绝对路径安装
(mytest) root@10-1xxx:/home/zhangsan/virtualenv# conda install ddddocr
/Users/zhangsan/miniconda3/envs/mytest/bin/python3.10 -m pip install html_table --trusted-host mirrors.aliyun.com -i https://pypi.tuna.tsinghua.edu.cn/simple
#https://cloud.tencent.com/developer/article/1533282
google-chrome --no-sandbox --headless --disable-gpu --screenshot https://www.baidu.com/
#外部安装包
#conda env list
#创建python虚拟环境
conda create -n mytest python=3.10
#激活pyhon环境
source activate mytest
#退出python虚拟环境
conda deactivate
#2
source deactivate base