在Windows 10上无法识别Conda命令

时间:2021-08-10 18:22:12

I installed Anaconda 4.4.0 (Python 3.6 version) on Windows 10 by following the instructions here: https://www.continuum.io/downloads. However, when I open the Command prompt window and try to write

我按照以下说明在Windows 10上安装了Anaconda 4.4.0(Python 3.6版本):https://www.continuum.io/downloads。但是,当我打开命令提示符窗口并尝试写入时

conda list

I get the

我明白了

'conda' command is not recognized...

'conda'命令无法识别...

error.

I tried to run

我试着跑

set PATH=%PATH%;C:\Users\Alex\Anaconda3

but it didn't help. I also read that I might need to edit my .bashrc file, but I don't know how to access this file, and how I should edit it.

但它没有帮助。我还读到我可能需要编辑我的.bashrc文件,但我不知道如何访问这个文件,以及我应该如何编辑它。

6 个解决方案

#1


55  

In Windows, you will have to set the path to the location where you installed Anaconda3 to.

在Windows中,您必须设置Anaconda3安装位置的路径。

For me, I installed anaconda3 into C:\Anaconda3. Therefore you need to add C:\Anaconda3 as well as C:\Anaconda3\Scripts\ to your path variable, e.g. set PATH=%PATH%;C:\Anaconda3;C:\Anaconda3\Scripts\.

对我来说,我将anaconda3安装到C:\ Anaconda3中。因此,您需要将C:\ Anaconda3以及C:\ Anaconda3 \ Scripts \添加到路径变量,例如设置PATH =%PATH%; C:\ Anaconda3; C:\ Anaconda3 \ Scripts \。

You can do this via powershell (see above, https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx ), or hit the windows key -> enter environment -> choose from settings -> edit environment variables for your account -> select Path variable -> Edit -> New.

你可以通过powershell(参见上面的https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx),或点击Windows键 - >输入环境 - >从设置中选择 - >编辑帐户的环境变量 - >选择路径变量 - >编辑 - >新建。

To test it, open a new dos shell, and you should be able to use conda commands now. E.g., try conda --version.

要测试它,打开一个新的dos shell,你现在应该可以使用conda命令了。例如,尝试conda --version。

#2


7  

When you install anaconda on windows now, it doesn't automatically add Python or Conda.

现在在Windows上安装anaconda时,它不会自动添加Python或Conda。

If you don’t know where your conda and/or python is, you type the following commands into your anaconda prompt

如果您不知道conda和/或python的位置,请在anaconda提示符下键入以下命令

在Windows 10上无法识别Conda命令

Next, you can add Python and Conda to your path by using the setx command in your command prompt. 在Windows 10上无法识别Conda命令

接下来,您可以在命令提示符中使用setx命令将Python和Conda添加到路径中。

Next close that command prompt and open a new one. Congrats you can now use conda and python

接下来关闭该命令提示符并打开一个新命令。恭喜你现在可以使用conda和python

Source: https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444

#3


1  

I had also faced the same problem just an hour back. I was trying to install QuTip Quantum Toolbox in Python Unfortunately, I didn't stumble onto this page in time. Say you have downloaded Anaconda installer and run it until the end. Naively, I opened the command prompt in windows 10 and proceded to type the following commands as given in the qutip installation docs.

一小时后我也遇到了同样的问题。我试图在Python中安装QuTip Quantum Toolbox不幸的是,我没有及时发现这个页面。假设您已经下载了Anaconda安装程序并运行它直到结束。天真地,我在Windows 10中打开了命令提示符,并按照qutip安装文档中的说明输入以下命令。

conda create -n qutip-env

conda create -n qutip-env

conda config --append channels conda-forge

conda config --append channels conda-forge

conda install qutip

conda安装qutip

But as soon as I typed the first line I got the following response

但是当我输入第一行时,我得到了以下响应

conda is not recognized as an internal or external command, operable program or batch file

conda不被识别为内部或外部命令,可操作程序或批处理文件

error messsage

I went ahead and tried some other things as seen in this figures error message Finally after going through a number conda websites, I understood how one fixes this problem. Type Anaconda prompt in the search bar at the bottom like this (same place where you hail Cortana) Anaconda prompt

我继续尝试了一些其他的东西,如图中所示错误消息最后,经过一些数字conda网站,我明白了如何解决这个问题。在底部的搜索栏中输入Anaconda提示符(这是你欢呼Cortana的地方)Anaconda提示

Once you are here all the conda commands will work as usual

一旦你在这里,所有conda命令将照常工作

#4


0  

Even I got the same problem when I've first installed Anaconda. It said 'conda' command not found.

当我第一次安装Anaconda时,我甚至遇到了同样的问题。它说没有找到'conda'命令。

So I've just setup two values[added two new paths of Anaconda] system environment variables in the PATH variable which are: C:\Users\mshas\Anaconda2\ & C:\Users\mshas\Anaconda2\Scripts

所以我只是在PATH变量中设置了两个值[添加两个新的Anaconda路径]系统环境变量:C:\ Users \ mshas \ Anaconda2 \&C:\ Users \ mshas \ Anaconda2 \ Scripts

Lot of people forgot to add the second variable which is "Scripts" just add that then 'conda' command works.

很多人忘了添加第二个变量,即“Scripts”,只需添加“conda”命令即可。

#5


0  

You need to add the python.exe in C://.../Anaconda3 installation file as well as C://.../Anaconda3/Scripts to PATH.

您需要将C://.../Anaconda3安装文件中的python.exe以及C://.../Anaconda3/Scripts添加到PATH。

First go to your installation directory, in my case it is installed in C://Users/user/Anaconda3 and shift+right click and press "Open command window here" or it might be "Open powershell here", if it is powershell, just write cmd and hit enter to run command window. Then run the following command setx PATH %cd%

首先进入你的安装目录,在我的例子中,它安装在C:// Users / user / Anaconda3中并按住shift并右键单击并在此处按“打开命令窗口”或者它可能是“在这里打开powershell”,如果它是powershell ,只需编写cmd并按Enter键运行命令窗口。然后运行以下命令setx PATH%cd%

Then go to C://Users/user/Anaconda3/Scripts and open the command window there as above, then run the same command "setx PATH %cd%"

然后转到C:// Users / user / Anaconda3 / Scripts并打开上面的命令窗口,然后运行相同的命令“setx PATH%cd%”

#6


0  

If you want to use Anaconda in regular cmd on windows you need to add several paths to your Path env variable.

如果要在Windows上的常规cmd中使用Anaconda,则需要向Path env变量添加多个路径。

Those paths are (instead of Anaconda3 the folder may be Anaconda2 depending on the Anaconda version on your PC):

这些路径是(而不是Anaconda3,文件夹可能是Anaconda2,具体取决于您电脑上的Anaconda版本):

\Users\YOUR_USER\Anaconda3
\Users\YOUR_USER\Anaconda3\Library\mingw-w64\bin
\Users\YOUR_USER\Anaconda3\Library\usr\bin
\Users\YOUR_USER\Anaconda3\Library\bin
\Users\YOUR_USER\Anaconda3\Scripts

#1


55  

In Windows, you will have to set the path to the location where you installed Anaconda3 to.

在Windows中,您必须设置Anaconda3安装位置的路径。

For me, I installed anaconda3 into C:\Anaconda3. Therefore you need to add C:\Anaconda3 as well as C:\Anaconda3\Scripts\ to your path variable, e.g. set PATH=%PATH%;C:\Anaconda3;C:\Anaconda3\Scripts\.

对我来说,我将anaconda3安装到C:\ Anaconda3中。因此,您需要将C:\ Anaconda3以及C:\ Anaconda3 \ Scripts \添加到路径变量,例如设置PATH =%PATH%; C:\ Anaconda3; C:\ Anaconda3 \ Scripts \。

You can do this via powershell (see above, https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx ), or hit the windows key -> enter environment -> choose from settings -> edit environment variables for your account -> select Path variable -> Edit -> New.

你可以通过powershell(参见上面的https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx),或点击Windows键 - >输入环境 - >从设置中选择 - >编辑帐户的环境变量 - >选择路径变量 - >编辑 - >新建。

To test it, open a new dos shell, and you should be able to use conda commands now. E.g., try conda --version.

要测试它,打开一个新的dos shell,你现在应该可以使用conda命令了。例如,尝试conda --version。

#2


7  

When you install anaconda on windows now, it doesn't automatically add Python or Conda.

现在在Windows上安装anaconda时,它不会自动添加Python或Conda。

If you don’t know where your conda and/or python is, you type the following commands into your anaconda prompt

如果您不知道conda和/或python的位置,请在anaconda提示符下键入以下命令

在Windows 10上无法识别Conda命令

Next, you can add Python and Conda to your path by using the setx command in your command prompt. 在Windows 10上无法识别Conda命令

接下来,您可以在命令提示符中使用setx命令将Python和Conda添加到路径中。

Next close that command prompt and open a new one. Congrats you can now use conda and python

接下来关闭该命令提示符并打开一个新命令。恭喜你现在可以使用conda和python

Source: https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444

#3


1  

I had also faced the same problem just an hour back. I was trying to install QuTip Quantum Toolbox in Python Unfortunately, I didn't stumble onto this page in time. Say you have downloaded Anaconda installer and run it until the end. Naively, I opened the command prompt in windows 10 and proceded to type the following commands as given in the qutip installation docs.

一小时后我也遇到了同样的问题。我试图在Python中安装QuTip Quantum Toolbox不幸的是,我没有及时发现这个页面。假设您已经下载了Anaconda安装程序并运行它直到结束。天真地,我在Windows 10中打开了命令提示符,并按照qutip安装文档中的说明输入以下命令。

conda create -n qutip-env

conda create -n qutip-env

conda config --append channels conda-forge

conda config --append channels conda-forge

conda install qutip

conda安装qutip

But as soon as I typed the first line I got the following response

但是当我输入第一行时,我得到了以下响应

conda is not recognized as an internal or external command, operable program or batch file

conda不被识别为内部或外部命令,可操作程序或批处理文件

error messsage

I went ahead and tried some other things as seen in this figures error message Finally after going through a number conda websites, I understood how one fixes this problem. Type Anaconda prompt in the search bar at the bottom like this (same place where you hail Cortana) Anaconda prompt

我继续尝试了一些其他的东西,如图中所示错误消息最后,经过一些数字conda网站,我明白了如何解决这个问题。在底部的搜索栏中输入Anaconda提示符(这是你欢呼Cortana的地方)Anaconda提示

Once you are here all the conda commands will work as usual

一旦你在这里,所有conda命令将照常工作

#4


0  

Even I got the same problem when I've first installed Anaconda. It said 'conda' command not found.

当我第一次安装Anaconda时,我甚至遇到了同样的问题。它说没有找到'conda'命令。

So I've just setup two values[added two new paths of Anaconda] system environment variables in the PATH variable which are: C:\Users\mshas\Anaconda2\ & C:\Users\mshas\Anaconda2\Scripts

所以我只是在PATH变量中设置了两个值[添加两个新的Anaconda路径]系统环境变量:C:\ Users \ mshas \ Anaconda2 \&C:\ Users \ mshas \ Anaconda2 \ Scripts

Lot of people forgot to add the second variable which is "Scripts" just add that then 'conda' command works.

很多人忘了添加第二个变量,即“Scripts”,只需添加“conda”命令即可。

#5


0  

You need to add the python.exe in C://.../Anaconda3 installation file as well as C://.../Anaconda3/Scripts to PATH.

您需要将C://.../Anaconda3安装文件中的python.exe以及C://.../Anaconda3/Scripts添加到PATH。

First go to your installation directory, in my case it is installed in C://Users/user/Anaconda3 and shift+right click and press "Open command window here" or it might be "Open powershell here", if it is powershell, just write cmd and hit enter to run command window. Then run the following command setx PATH %cd%

首先进入你的安装目录,在我的例子中,它安装在C:// Users / user / Anaconda3中并按住shift并右键单击并在此处按“打开命令窗口”或者它可能是“在这里打开powershell”,如果它是powershell ,只需编写cmd并按Enter键运行命令窗口。然后运行以下命令setx PATH%cd%

Then go to C://Users/user/Anaconda3/Scripts and open the command window there as above, then run the same command "setx PATH %cd%"

然后转到C:// Users / user / Anaconda3 / Scripts并打开上面的命令窗口,然后运行相同的命令“setx PATH%cd%”

#6


0  

If you want to use Anaconda in regular cmd on windows you need to add several paths to your Path env variable.

如果要在Windows上的常规cmd中使用Anaconda,则需要向Path env变量添加多个路径。

Those paths are (instead of Anaconda3 the folder may be Anaconda2 depending on the Anaconda version on your PC):

这些路径是(而不是Anaconda3,文件夹可能是Anaconda2,具体取决于您电脑上的Anaconda版本):

\Users\YOUR_USER\Anaconda3
\Users\YOUR_USER\Anaconda3\Library\mingw-w64\bin
\Users\YOUR_USER\Anaconda3\Library\usr\bin
\Users\YOUR_USER\Anaconda3\Library\bin
\Users\YOUR_USER\Anaconda3\Scripts