无法将“ Conda”识别为内部或外部命令

问题:无法将“ Conda”识别为内部或外部命令

我在Windows 7 Professional计算机上安装了Anaconda3 4.4.0(32位),并在Jupyter笔记本电脑上导入了NumPy和Pandas,因此我认为Python已正确安装。但是当我键入conda listconda --version在命令提示符下时,它说conda is not recognized as internal or external command.

我已经为Anaconda3设置了环境变量;Variable Name: PathVariable Value: C:\Users\dipanwita.neogy\Anaconda3

我该如何运作?

I installed Anaconda3 4.4.0 (32 bit) on my Windows 7 Professional machine and imported NumPy and Pandas on Jupyter notebook so I assume Python was installed correctly. But when I type conda list and conda --version in command prompt, it says conda is not recognized as internal or external command.

I have set environment variable for Anaconda3; Variable Name: Path, Variable Value: C:\Users\dipanwita.neogy\Anaconda3

How do I make it work?


回答 0

尽管其他人为您提供了很好的解决方案,但我认为指出实际情况会有所帮助。根据Anaconda 4.4更改日志,https : //docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4 :

在Windows上,默认情况下不再更改PATH环境变量,因为这可能导致其他软件出现问题。建议的方法是,当您希望使用Anaconda软件时,改用Anaconda Navigator或Anaconda命令提示符(位于“ Anaconda”下的“开始”菜单中)。

(注意:最近的Win 10并不假定您具有安装或更新的特权。如果命令失败,请右键单击Anaconda命令提示符,选择“更多”,选择“以管理员身份运行”)

这是对先前安装的更改。尽管您也可以随时将其添加到PATH中,但建议使用Navigator或Anaconda Prompt。在安装过程中,现在没有选中将Anaconda添加到PATH的框,但是您可以选择它。

Although you were offered a good solution by others I think it is helpful to point out what is really happening. As per the Anaconda 4.4 changelog, https://docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4:

On Windows, the PATH environment variable is no longer changed by default, as this can cause trouble with other software. The recommended approach is to instead use Anaconda Navigator or the Anaconda Command Prompt (located in the Start Menu under “Anaconda”) when you wish to use Anaconda software.

(Note: recent Win 10 does not assume you have privileges to install or update. If the command fails, right-click on the Anaconda Command Prompt, choose “More”, chose “Run as administrator”)

This is a change from previous installations. It is suggested to use Navigator or the Anaconda Prompt although you can always add it to your PATH as well. During the install the box to add Anaconda to the PATH is now unchecked but you can select it.


回答 1

我在Windows 10中遇到了同样的问题,请按照以下步骤更新环境变量,它可以正常工作。

我知道这对于简单的环境设置来说是一个冗长的答案,我认为这对于新窗口10用户可能有用。

1)打开Anaconda提示:

2)检查Conda安装位置。

where conda

3)打开高级系统设置

4)点击环境变量

5)编辑路径

6)添加新路径

 C:\Users\RajaRama\Anaconda3\Scripts

 C:\Users\RajaRama\Anaconda3

 C:\Users\RajaRama\Anaconda3\Library\bin

7)打开命令提示符并检查版本

8)在第7步键入conda之后,在cmd中安装anaconda-navigator,然后按y

I was faced with the same issue in windows 10, Updating the environment variable following steps, it’s working fine.

I know It is a lengthy answer for the simple environment setups, I thought it’s may be useful for the new window 10 users.

1) Open Anaconda Prompt:

2) Check Conda Installed Location.

where conda

3) Open Advanced System Settings

4) Click on Environment Variables

5) Edit Path

6) Add New Path

 C:\Users\RajaRama\Anaconda3\Scripts

 C:\Users\RajaRama\Anaconda3

 C:\Users\RajaRama\Anaconda3\Library\bin

7) Open Command Prompt and Check Versions

8) After 7th step type conda install anaconda-navigator in cmd then press y


回答 2

我找到了解决方案。可变值应为C:\Users\dipanwita.neogy\Anaconda3\Scripts

I found the solution. Variable value should be C:\Users\dipanwita.neogy\Anaconda3\Scripts


回答 3

现在在Windows上安装anaconda时,它不会自动将Python或Conda添加到您的路径中。

在安装过程中,您可以选中此框,也可以将python和/或python手动添加到路径中(如下面的图片所示)

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

where python
where conda

接下来,您可以通过在命令提示符下使用setx命令将Python和Conda添加到您的路径中(替换C:\Users\mgalarnyk\Anaconda2为运行时获得的结果where pythonwhere conda)。

SETX PATH "%PATH%;C:\Users\mgalarnyk\Anaconda2\Scripts;C:\Users\mgalarnyk\Anaconda2"

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

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

When you install anaconda on windows now, it doesn’t automatically add Python or Conda to your path.

While during the installation process you can check this box, you can also add python and/or python to your path manually (as you can see below the image)

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

where python
where conda

Next, you can add Python and Conda to your path by using the setx command in your command prompt (replace C:\Users\mgalarnyk\Anaconda2 with the results you got when running where python and where conda).

SETX PATH "%PATH%;C:\Users\mgalarnyk\Anaconda2\Scripts;C:\Users\mgalarnyk\Anaconda2"

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

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


回答 4

为了清楚起见,您需要转到controlpanel\System\Advanced system settings\Environment Variables\Path,然后点击编辑并添加:

C:Users\user.user\Anaconda3\Scripts

到最后并重新启动cmd行

Just to be clear, you need to go to the controlpanel\System\Advanced system settings\Environment Variables\Path, then hit edit and add:

C:Users\user.user\Anaconda3\Scripts

to the end and restart the cmd line


回答 5

如果您有较新版本的Anaconda Navigator,请打开安装中附带的Anaconda Prompt程序。在此处输入所有常用的conda update/ conda install命令。

我认为上面的答案可以解释这一点,但是我可以使用这样一个非常简单的指令。也许会帮助别人。

If you have a newer version of the Anaconda Navigator, open the Anaconda Prompt program that came in the install. Type all the usual conda update/conda install commands there.

I think the answers above explain this, but I could have used a very simple instruction like this. Perhaps it will help others.


回答 6

除了添加C:\Users\yourusername\Anaconda3和之外C:\Users\yourusername\Anaconda3\Scripts(如Raja所建议的那样),还将添加C:\Users\yourusername\Anaconda3\Library\bin到您的path变量中。如果您是在全新安装的Anaconda上执行此操作,则可以防止发生SSL错误。

In addition to adding C:\Users\yourusername\Anaconda3 and C:\Users\yourusername\Anaconda3\Scripts, as recommended by Raja (above), also add C:\Users\yourusername\Anaconda3\Library\bin to your path variable. This will prevent an SSL error that is bound to happen if you’re performing this on a fresh install of Anaconda.


回答 7

转到anaconda提示符(在笔记本电脑的搜索框中键入“ anaconda”)。输入以下命令

where conda

将该位置添加到您的环境路径变量中。关闭cmd,然后再次打开

Go To anaconda prompt(type “anaconda” in search box in your laptop). type following commands

where conda

add that location to your environment path variables. Close the cmd and open it again


回答 8

如果您不想将Anaconda添加到环境中。路径,并且您正在使用Windows,请尝试以下操作:

  • 打开cmd;
  • 键入文件夹安装的路径。就像这样:C:\ Users \ your_home文件夹\ Anaconda3 \ Scripts
  • 测试Anaconda,例如conda –version类型。
  • 更新Anaconda:conda更新conda或conda更新-全部或conda更新anaconda。

更新Spyder:

  • 康达更新qt pyqt
  • 康达更新间谍

If you don’t want to add Anaconda to env. path and you are using Windows try this:

  • Open cmd;
  • Type path to your folder instalation. It’s something like: C:\Users\your_home folder\Anaconda3\Scripts
  • Test Anaconda, for exemple type conda –version.
  • Update Anaconda: conda update conda or conda update –all or conda update anaconda.

Update Spyder:

  • conda update qt pyqt
  • conda update spyder

回答 9

我有Windows 10 64位,这对我有用此解决方案可以在两种(Anaconda / MiniConda)发行版中都可以使用。

  1. 首先,尝试卸载引起问题的anaconda / miniconda
  2. 之后,从“ C:\ Users \”删除“ .anaconda”和“ .conda”文件夹
  3. 如果您有任何杀毒软件装然后尝试排除所有文件夹,子文件夹内的“C:\ ProgramData \ Anaconda3 \”

    • 行为检测。
    • 病毒检测。
    • DNA扫描。
    • 可疑文件扫描。
    • 任何其他病毒防护模式。

    *(注意:“ C:\ ProgramData \ Anaconda3”此文件夹是默认安装文件夹,您可以在安装Anaconda时更改它,仅在安装目标位置提示处替换排除的路径)*

  4. 现在,以管理员权限安装Anaconda。
    • 将安装路径设置为“ C:\ ProgramData \ Anaconda3”或者您可以指定自定义路径,只是要记住该路径不应包含任何空格,并且应将其从病毒检测中排除。
    • 在“高级安装选项”中,您可以选中“将Anaconda添加到我的PATH环境变量(可选)”和“将Anaconda注册为我的默认Python 3.6”
    • 使用其他默认设置进行安装。完成后单击完成。
    • 重启你的电脑。

现在打开命令提示符或Anaconda提示符并使用以下命令检查安装

康达清单

如果您获得任何软件包列表,则表明anaconda / miniconda已成功安装。

I have Windows 10 64 bit, this worked for me, This solution can work for both (Anaconda/MiniConda) distributions.

  1. First of all try to uninstall anaconda/miniconda which is causing problem.
  2. After that delete ‘.anaconda’ and ‘.conda’ folders from ‘C:\Users\’
  3. If you have any antivirus software installed then try to exclude all the folders,subfolders inside ‘C:\ProgramData\Anaconda3\’ from

    • Behaviour detection.
    • Virus detection.
    • DNA scan.
    • Suspicious files scan.
    • Any other virus protection mode.

    *(Note: ‘C:\ProgramData\Anaconda3’ this folder is default installation folder, you can change it just replace your excluded path at installation destination prompt while installing Anaconda)*

  4. Now install Anaconda with admin privileges.
    • Set the installation path as ‘C:\ProgramData\Anaconda3’ or you can specify your custom path just remember it should not contain any white space and it should be excluded from virus detection.
    • At Advanced Installation Options you can check “Add Anaconda to my PATH environment variable(optional)” and “Register Anaconda as my default Python 3.6”
    • Install it with further default settings. Click on finish after done.
    • Restart your computer.

Now open Command prompt or Anaconda prompt and check installation using following command

conda list

If you get any package list then the anaconda/miniconda is successfully installed.


回答 10

当我多次安装Anaconda时,这个问题对我来说就出现了。我很小心地进行了卸载,但是有些事情卸载过程不会撤消。

就我而言,我需要删除一个文件Microsoft.PowerShell_profile.ps1~\Documents\WindowsPowerShell\。通过在文本编辑器中将其打开,我确定了该文件是罪魁祸首。我看到它引用了旧的安装位置C:\Anaconda3\

This problem arose for me when I installed Anaconda multiple times. I was careful to do an uninstall but there are some things that the uninstall process doesn’t undo.

In my case, I needed to remove a file Microsoft.PowerShell_profile.ps1 from ~\Documents\WindowsPowerShell\. I identified that this file was the culprit by opening it in a text editor. I saw that it referenced the old installation location C:\Anaconda3\.


回答 11

我刚刚启动了anaconda-navigator并从那里运行conda命令。

I have just launched anaconda-navigator and run the conda commands from there.


回答 12

我在Windows中遇到了这个问题。大多数答案都不是anaconda推荐的,您不应将路径添加到环境变量中,因为它可能会破坏其他内容。相反,您应该使用顶部答案中提到的anaconda提示符。

但是,这也可能会中断。在这种情况下,右键单击快捷方式,转到快捷方式选项卡,目标值应类似于:

%windir%\System32\cmd.exe "/K" C:\Users\myUser\Anaconda3\Scripts\activate.bat C:\Users\myUser\Anaconda3

I had this problem in windows. Most of the answers are not as recommended by anaconda, you should not add the path to the environment variables as it can break other things. Instead you should use anaconda prompt as mentioned in the top answer.

However, this may also break. In this case right click on the shortcut, go to shortcut tab, and the target value should read something like:

%windir%\System32\cmd.exe "/K" C:\Users\myUser\Anaconda3\Scripts\activate.bat C:\Users\myUser\Anaconda3