Anaconda3 does not use environment variables to build a virtual environment

Download the
mirror website of Tsinghua University and choose the appropriate version of anaconda

The following is the 2020.11 version

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.11-Linux-x86_64.sh

Install in a local folder

bash Anaconda3-2020.11-Linux-x86_64.sh

Enter the catalog: cd anaconda3/bin

Since there is no environment variable configured, go directly to the bin directory of the installation and call conda to run to establish a virtual environment.

./conda create -n paddle1 python=3.7 numpy pandas

./conda create -n 定义的虚拟环境的名字 python=版本号 预先安装的包

Activate the environment

conda activate 定义的虚拟环境的名字

Activation error:
1 Terminal input firstsource activate

2 Enter the virtual environment command you want to activate

conda activate your_virtual_name

Still wrong, try this
1 and then enter source deactivate or conda deactivate in the terminal

When re-entering in the future, follow the following commands to run in sequence

cd anaconda3/bin
source activate
conda activate paddle1

It can also be written as an sh file, and run through source ./filename.sh with one key. The
writing method is as follows

#!/bin/sh
cd anaconda3/bin #你anaconda3的bin文件夹的路径
source activate
conda activate 定义的虚拟环境的名字
echo "conda activate 定义的虚拟环境的名字 successful!" # echo is used to printf in terminal

Incidental record of the command line to open the virtual environment in pycharm

(pycharm中在线链接 工具 ----start ssh session, 选择)

Guess you like

Origin blog.csdn.net/weixin_43134049/article/details/114838909