搭建conda环境
[root@718945e39174 opt]# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh
[root@718945e39174 opt]# sh Miniconda3-py37_4.8.3-Linux-x86_64.sh
# 安装过程:
# <1>同意协议: yes
# Do you accept the license terms? [yes|no]
# Please answer 'yes' or 'no':
# >>> yes
#
# <2>选择安装目录: 例如/opt/miniconda3 (默认安装在/root/miniconda3目录)
# [/root/miniconda3] >>> /opt/miniconda3
#
# <3>同意添加环境变量: yes,建议自动配置
# Do you wish the installer to initialize # # # Miniconda3
# by running conda init? [yes|no]
# [no] >>> yes
# 一般安装软件完成后需要重启,在Linux叫激活,有两种方式,第一种是重新登录服务器,第二种是输入以下命令:
source ~/.bashrc # 生效环境变量(自动进入虚拟环境base)
# conda config --set auto_activate_base false
conda create -n myenv python=3.6.13
conda activate myenv
常用命令
- conda env list # 展示所有环境
- conda activate myenv # 启动环境
查找Python安装包位置(记录)
/root/anaconda3/envs/torchcu11/lib/python3.6/site-packages
/home/bosszyl/.local/lib/python3.6/site-packages/docx #python-docx