Python “Conda”未被识别为内部或外部命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44515769/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
'Conda' is not recognized as internal or external command
提问by Kshitiz
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.
我在 Windows 7 Professional 机器上安装了 Anaconda3 4.4.0(32 位)并在 Jupyter 笔记本上导入了 NumPy 和 Pandas,所以我假设 Python 安装正确。但是当我在命令提示符中输入conda list
和输入时conda --version
,它说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
我已经为 Anaconda3 设置了环境变量;Variable Name: Path
,Variable Value: C:\Users\dipanwita.neogy\Anaconda3
How do I make it work?
我如何使它工作?
回答by John Morrison
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:
尽管其他人为您提供了一个很好的解决方案,但我认为指出实际发生的情况会有所帮助。根据 Anaconda 4.4 更新日志,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.
在 Windows 上,默认情况下不再更改 PATH 环境变量,因为这可能会导致其他软件出现问题。当您希望使用 Anaconda 软件时,推荐的方法是使用 Anaconda Navigator 或 Anaconda 命令提示符(位于“Anaconda”下的开始菜单中)。
(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")
(注意:最近的 Win 10 不假设你有安装或更新的权限。如果命令失败,请右键单击 Anaconda 命令提示符,选择“更多”,选择“以管理员身份运行”)
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.
这是对以前安装的更改。建议使用 Navigator 或 Anaconda Prompt,尽管您也可以随时将其添加到 PATH 中。在安装过程中,将 Anaconda 添加到 PATH 的框现在未选中,但您可以选择它。
回答by Raja Rama Mohan Thavalam
I was faced with the same issue in windows 10, Updating the environment variable following steps, it's working fine.
我在 Windows 10 中遇到了同样的问题,按照步骤更新环境变量,它工作正常。
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.
我知道对于简单的环境设置来说这是一个冗长的答案,我认为它可能对新的 window 10 用户有用。
1) Open Anaconda Prompt:
1) 打开 Anaconda 提示:
2) Check Conda Installed Location.
2) 检查 Conda 安装位置。
where conda
3) Open Advanced System Settings
3) 打开高级系统设置
4) Click on Environment Variables
4)点击环境变量
5) Edit Path
5) 编辑路径
6) Add New Path
6) 添加新路径
C:\Users\RajaRama\Anaconda3\Scripts
C:\Users\RajaRama\Anaconda3
C:\Users\RajaRama\Anaconda3\Library\bin
7) Open Command Prompt and Check Versions
7) 打开命令提示符并检查版本
8) After 7th step type conda install anaconda-navigator in cmd then press y
8) 在第 7 步之后,在 cmd 中输入 conda install anaconda-navigator 然后按 y
回答by Kshitiz
I found the solution.
Variable value should be C:\Users\dipanwita.neogy\Anaconda3\Scripts
我找到了解决方案。变量值应该是C:\Users\dipanwita.neogy\Anaconda3\Scripts
回答by Michael James Kali Galarnyk
When you install anaconda on windows now, it doesn't automatically add Python or Conda to your path.
当您现在在 Windows 上安装 anaconda 时,它不会自动将 Python 或 Conda 添加到您的路径中。
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)
在安装过程中,您可以选中此框,也可以手动将 python 和/或 python 添加到您的路径中(如下图所示)
If you don't know where your conda and/or python is, you type the following commands into your anaconda prompt
如果您不知道 conda 和/或 python 在哪里,请在 anaconda 提示符中键入以下命令
where python
where conda
Next, you can add Python and Condato 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 命令将Python 和 Conda添加到您的路径中(替换C:\Users\mgalarnyk\Anaconda2
为您在运行where python
和时获得的结果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
接下来关闭该命令提示符并打开一个新的。恭喜你现在可以使用 conda 和 python
Source: https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444
来源:https: //medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444
回答by Carl
Just to be clear, you need to go to the controlpanel\System\Advanced system settings\Environment Variables\Path
,
then hit edit and add:
为了清楚起见,您需要转到controlpanel\System\Advanced system settings\Environment Variables\Path
,然后点击编辑并添加:
C:Users\user.user\Anaconda3\Scripts
to the end and restart the cmd line
到最后并重新启动 cmd 行
回答by MokeEire
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.
如果您有较新版本的 Anaconda Navigator,请打开安装中的 Anaconda Prompt 程序。在那里输入所有常用的conda update
/conda install
命令。
I think the answers above explain this, but I could have used a very simple instruction like this. Perhaps it will help others.
我认为上面的答案解释了这一点,但我可以使用这样一个非常简单的说明。也许它会帮助别人。
回答by Thomas Matthew
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.
除了按照 Raja(上文)的建议添加C:\Users\yourusername\Anaconda3
和C:\Users\yourusername\Anaconda3\Scripts
之外,还要添加C:\Users\yourusername\Anaconda3\Library\bin
到您的路径变量中。如果您在全新安装的 Anaconda 上执行此操作,这将防止必然发生的 SSL 错误。
回答by PALLAMOLLA SAI
Go To anaconda prompt(type "anaconda" in search box in your laptop). type following commands
转到 anaconda 提示(在笔记本电脑的搜索框中键入“anaconda”)。输入以下命令
where conda
add that location to your environment path variables. Close the cmd and open it again
将该位置添加到您的环境路径变量中。关闭cmd再打开
回答by Dragos Alexe
If you don't want to add Anaconda to env. path and you are using Windows try this:
如果您不想将 Anaconda 添加到 env。路径并且您使用的是 Windows 试试这个:
- 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.
- 打开cmd;
- 键入文件夹安装的路径。它类似于:C:\Users\your_home 文件夹\Anaconda3\Scripts
- 测试 Anaconda,例如类型 conda --version。
- 更新 Anaconda:conda update conda 或 conda update --all 或 conda update anaconda。
Update Spyder:
更新间谍:
- conda update qt pyqt
- conda update spyder
- 康达更新qt pyqt
- 康达更新间谍
回答by Aaron Brown
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.
当我多次安装 Anaconda 时,出现了这个问题。我很小心地进行了卸载,但是卸载过程中有些事情是无法撤消的。
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\
.
就我而言,我需要Microsoft.PowerShell_profile.ps1
从~\Documents\WindowsPowerShell\
. 我通过在文本编辑器中打开它来确定这个文件是罪魁祸首。我看到它引用了旧的安装位置C:\Anaconda3\
。