Using anaconda to create a python virtual environment under Linux

1. Make sure anaconda is installed before creating.

2. Enter the conda command in the Linux system terminal (can also be under the terminal in pycharm) to enter the conda environment.

conda

 

 3. Use the command conda create --name environment name python==3.6 to create the environment you want to create (name the environment name yourself).

conda create --name 环境名称 python==3.6

 4. The following is displayed, enter y to continue.

 5. Enter conda env list to display the virtual environment list. You can see the environment and path you just created.

conda env list 

 

 6. Open pycharm and click on the current interpreter (python3.x) in the lower right corner.

 7. Click Add Interpreter... . 

8. Select Existing environment and click the three dots behind it.

 9. Find the name of the environment you created based on the path you just found, click in to find the python.exe file, and finally click "OK".

 10. Enter the conda activate environment name in the pycharm terminal to enter the environment you created. At this time, the previous base has been changed to the environment name you created.

conda activate 环境名称

 11. Finally, you can use the pip command to install the packages you need.

Guess you like

Origin blog.csdn.net/m0_70017945/article/details/130161104