Note that the command for activating an environment has changed in Conda version 4.4. The recommended way of activating an environment is now conda activate myenv instead of source activate myenv. To enable the new syntax, you should modify your .bashrc file. The line that currently reads something like
This only adds the conda command to the path, but does not yet activate the base environment (which was previously called root). To do also that, add another line
conda activate base
after the first command. See all the details in Anaconda’s blog post from December 2017. (I think that this page is currently missing a newline between the two lines, it says .../conda.shconda activate base).
(This answer is valid for Linux, but it might be relevant for Windows and Mac as well)
conda activate was introduced in conda 4.4 and 4.6.
conda activate: The logic and mechanisms underlying environment activation have been reworked. With conda 4.4, conda activate and conda deactivate are now the preferred commands for activating and deactivating environments. You’ll find they are much more snappy than the source activate and source deactivate commands from previous conda versions. The conda activate command also has advantages of (1) being universal across all OSes, shells, and platforms, and (2) not having path collisions with scripts from other packages like python virtualenv’s activate script.
These new sub-commands are available in “Aanconda Prompt” and “Anaconda Powershell Prompt” automatically. To use conda activate in every shell (normal cmd.exe and powershell), check expose conda command in every shell on Windows.
As you can see from the error message the paths, that you specified, are wrong. Try it like this:
activate ..\..\temp\venv\test
However, when I needed to install Anaconda, I downloaded it from here and installed it to the default paths (C:\Anaconda), than I put this path to the environment variables, so now Anacondas interpreter is used as default. If you are using PyCharm, for example, you can specify the interpreter there directly.
回答 5
以下是它对我的工作方式
C:\ Windows \ system32>设置CONDA_ENVS_PATH = d:\您的\位置
C:\ Windows \ system32> conda信息
显示新的环境路径
C:\ Windows \ system32> conda创建-n YourNewEnvironment –clone = root
just as @Simba has rightly answered alot has changed in the conda env since 4.6. Conda activate (env-name) overthrew source activate (env-name) for good but not without it own challenges. conda activate oftentimes force your environment to base and make u see something like . Therefore throwing loads of error back at you. This can also be because auto_activate_base is set to True.