我在我的Windows 7 Professional机器上安装了Anaconda3 4.4.0(32位),并在Jupyter笔记本上导入了NumPy和Pandas,所以我假设Python安装正确。但是当我在命令提示符中输入conda list和conda——version时,它说conda不被识别为内部或外部命令。

我已经为Anaconda3设置了环境变量;变量名称:Path,变量值:C:\Users\dipanwita.neogy\Anaconda3

我该怎么做呢?


当前回答

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

where conda

将该位置添加到环境路径变量中。关闭cmd并再次打开它

其他回答

我有64位的Windows 10,这对我来说很有效, 此解决方案可以同时适用于(Anaconda/MiniConda)两个发行版。

First of all try to uninstall anaconda/miniconda which is causing problem. After that delete '.anaconda' and '.conda' folders from 'C:\Users\' 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)* 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.

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

conda列表

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

虽然别人给你提供了一个很好的解决方案,但我认为指出真正发生的事情是有帮助的。根据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命令提示符,选择“更多”,选择“以管理员身份运行”)

这与以前的安装有所不同。建议使用Navigator或Anaconda Prompt,尽管您也可以将其添加到PATH中。在安装过程中,添加Anaconda到PATH的盒子现在是未选中的,但你可以选择它。

对于版本大于4.6的conda,从Anaconda提示符的底部运行

conda update conda
conda init

这将更新conda根环境,并设置在cwd和powershell上运行它所需的东西。

在此之后,您可以启动任何终端,它将conda就绪。

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

需要明确的是,你需要进入控制面板\系统\高级系统设置\环境变量\路径, 然后点击编辑并添加:

C:Users\user.user\Anaconda3\Scripts

并重新启动CMD行