After UBuntu installs Anaconda3 and creates a virtual environment, the activate command cannot be used to activate the environment (solved)

In the tutorials I watched, the commands to create a virtual environment are:

conda create –n [虚拟环境名] python=[版本号] numpy scipy matplotlib jupyter[软件包]

But there is no way to create it, although I don’t know why, so I replaced it with the following command:

conda create --p tensorflow python=3.8 anaconda

Adding anaconda will automatically download the commonly used packages without specifying them one by one. --p and --prefix are the same. At this time, the created environment is in the same directory as the original environment.

You can add = path name after --p to specify a specific path. After creating a virtual environment with this command, you still cannot use the activate command to activate the virtual environment. Finally, you use the clone command to create a python environment that is the same as the original one. virtual environment

conda create --name [虚拟环境名] --clone base

When the creation is complete, the created location is as follows. The default installation path is located in the envs folder under the anaconda installation directory. It needs to be installed in this path to use the activate command:

At this time, you can use the command source activate tensorflow to activate the environment.

Commonly used commands in the creation process can refer to this link:

https://www.cnblogs.com/chenlove/p/13869837.html

 

Guess you like

Origin blog.csdn.net/weixin_42149550/article/details/110873206
Recommended