Python 如何在 Windows 10(64 位)中访问 Anaconda 命令提示符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47914980/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 18:26:22  来源:igfitidea点击:

How to access Anaconda command prompt in Windows 10 (64-bit)

pythonanaconda

提问by user44796

I had to install the 64-bit version of Anaconda with python 3.5 in Windows 10. I followed the default settings (AppData/Continuum/Anaconda3). However, after installation, I am unsure how to access the Anaconda command prompt so that I can use conda to install packages. I also attempted to install Anaconda 64 bit in C:/Program Files,but several of the python script did not like the space and it failed to install.

我必须在 Windows 10 中使用 python 3.5 安装 64 位版本的 Anaconda。我遵循默认设置 ( AppData/Continuum/Anaconda3)。但是,安装后,我不确定如何访问 Anaconda 命令提示符以便我可以使用 conda 安装软件包。我还尝试安装 Anaconda 64 位,C:/Program Files,但有几个 python 脚本不喜欢这个空间并且安装失败。

What can I do to access the Anaconda prompt?

如何访问 Anaconda 提示?

回答by Mike Müller

Go with the mouse to the Windows Icon (lower left) and start typing "Anaconda". There should show up some matching entries. Select "Anaconda Prompt". A new command window, named "Anaconda Prompt" will open. Now, you can work from there with Python, conda and other tools.

将鼠标移至 Windows 图标(左下方)并开始输入“Anaconda”。应该显示一些匹配的条目。选择“Anaconda 提示”。将打开一个名为“Anaconda Prompt”的新命令窗口。现在,您可以使用 Python、conda 和其他工具从那里开始工作。

回答by Cloud Cho

To run Anaconda Prompt using icon, I made an icon and put

要使用图标运行 Anaconda Prompt,我制作了一个图标并放置

%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3The file location would be different in each computer.

%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3每台计算机中的文件位置都不同。

at icon -> right click -> Property -> Shortcut -> Target

在图标 -> 右键单击​​ -> 属性 -> 快捷方式 -> 目标

I see %HOMEPATH%at icon -> right click -> Property -> Start in

我看到%HOMEPATH%图标 -> 右键单击​​ -> 属性 -> 开始

OS: Windows 10, Library: Anaconda 10 (64 bit)

操作系统:Windows 10,库:Anaconda 10(64 位)

回答by Volker von Einem

I added "\Anaconda3_64\" and "\Anaconda3_64\Scripts\" to the PATH variable. Then I can use conda from powershell or command prompt.

我在 PATH 变量中添加了“\Anaconda3_64\”和“\Anaconda3_64\Scripts\”。然后我可以从 powershell 或命令提示符使用 conda。

回答by Abdulrahman Bres

To create Anaconda Prompt using Command Prompt, just create a shortcut file of Command Prompt and modify the shortcut target to:

要使用命令提示符创建 Anaconda Prompt,只需创建命令提示符的快捷方式文件并将快捷方式目标修改为:

%windir%\System32\cmd.exe "/K" <Anaconda Location>\anaconda3\Scripts\activate.bat

%windir%\System32\cmd.exe "/K" <Anaconda Location>\anaconda3\Scripts\activate.bat

Example:

例子:

%windir%\system32\cmd.exe "/K" C:\Users\user_1\AppData\Local\Continuum\anaconda3\Scripts\activate.bat

%windir%\system32\cmd.exe "/K" C:\Users\user_1\AppData\Local\Continuum\anaconda3\Scripts\activate.bat

回答by Tobi Obeck

How to add anaconda installation directory to your PATH variables

如何将 anaconda 安装目录添加到 PATH 变量中

1. open environmental variableswindow

1.打开环境变量窗口

Do this by either going to my computerand then right clicking the background for the context menu > "properties". On the left side open "advanced system settings" or just search for "env..." in start menu ([Win]+[s] keys).

通过转到我的计算机然后右键单击上下文菜单的背景>“属性”来执行此操作。在左侧打开“高级系统设置”或在开始菜单中搜索“env...”([Win]+[s] 键)。

Then click on environment variables

然后点击环境变量

If you struggle with this step read this explanation.

如果您在这一步遇到困难,请阅读此说明

2. Edit Path in the user environmental variablessection and add three new entries:

2. 在用户环境变量部分编辑 Path并添加三个新条目:

  • D:\path\to\anaconda3
  • D:\path\to\anaconda3\Scripts
  • D:\path\to\anaconda3\Library\bin
  • D:\path\to\anaconda3
  • D:\path\to\anaconda3\Scripts
  • D:\path\to\anaconda3\Library\bin

D:\path\to\anaconda3should be the folder where you have installed anaconda

D:\path\to\anaconda3应该是你安装anaconda的文件夹

Click [OK] on all opened windows.

在所有打开的窗口上单击 [确定]。

If you did everything correctly, you can test a condacommand by opening a newpowershell window.

如果你做的一切都正确,你可以conda通过打开一个新的powershell 窗口来测试命令。

conda --version

This should output something like: conda 4.8.2

这应该输出如下内容: conda 4.8.2

回答by djm457

After installing Anaconda3 on your system you need to add Anaconda to the PATH environment variable. This will allow you to access Anaconda with the 'conda' command from cmd.exe or PowerShell.

在您的系统上安装 Anaconda3 后,您需要将 Anaconda 添加到 PATH 环境变量中。这将允许您使用 cmd.exe 或 PowerShell 中的“conda”命令访问 Anaconda。

The link I provided below go through the three major issues with not recognized error. Which are:

我在下面提供的链接通过未识别的错误解决了三个主要问题。哪个是:

  1. Environment PATH for Conda is not set
  2. Environment PATH is incorrectly added
  3. Anaconda version is older than the version of the Anaconda Navigator
  1. 未设置 Conda 的环境路径
  2. 环境 PATH 添加不正确
  3. Anaconda 版本比 Anaconda Navigator 版本旧

LINK: https://appuals.com/fix-conda-is-not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file/

链接:https: //appuals.com/fix-conda-is-not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file/

My issue was resolved following the steps for issue #2 Environment PATH is incorrectly added. I did not have all three file paths in my variable environment.

我的问题已按照问题 #2 Environment PATH 被错误添加的步骤解决。我的变量环境中没有所有三个文件路径。