Python Anaconda3 activate.bat 未被识别为内部或外部命令

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

Anaconda3 activate.bat is not recognized as an internal or external command

pythonanacondajupyterconda

提问by Maged Saeed

I have downloaded Anaconda3 for windows 64-bit operating system. After the download and install completed, I opened the Anaconda prompt but it give me this nice error:

我已经为 Windows 64 位操作系统下载了 Anaconda3。下载和安装完成后,我打开了 Anaconda 提示,但它给了我这个很好的错误:

'C:\Anaconda3\Scripts\activate.bat' is not recognized as an internal or external command,operable program or batch file.

I just surfed the internet and found a solution to uninstall all previous packages of python but did not work. I have searched for activate.bat file in my system " found it in one folders of anaconda directory " and copy, paste it to the Scripts folder but it gives me errors with conda packages and dependencies. Any solutions please!!
I cannot run any either jupyter notebook or conda as well. Actually, I do not know how to find them in those bunch of Anaconda files and packages.

我刚刚在网上冲浪,找到了卸载以前所有python包的解决方案,但没有用。我在我的系统中搜索了 activate.bat 文件“在 anaconda 目录的一个文件夹中找到它”并将其复制、粘贴到 Scripts 文件夹,但它给了我 conda 包和依赖项的错误。请问有什么解决办法!!
我也无法运行任何 jupyter notebook 或 conda。实际上,我不知道如何在那些 Anaconda 文件和包中找到它们。

Thanks in advance,,,.

提前致谢,,,。

采纳答案by Maged Saeed

I think the problem will be solved by clearing all dependencies.
I initially had python installed, 2.7 and 3.6. I just get rid of all of them. The problem is not solved yet.

我认为问题将通过清除所有依赖项来解决。
我最初安装了 python,2.7 和 3.6。我只是摆脱了他们。问题还没有解决。

I discovered that My MySQL server is running. I just closed it but it did not work. I just uninstalled it completely and The problem is solved.
Anaconda needs to listen to , I think 8888 port, which might be used also by MySQL server as well.

我发现我的 MySQL 服务器正在运行。我刚刚关闭它,但它不起作用。我刚刚完全卸载它,问题就解决了。
Anaconda 需要监听,我认为 8888 端口,它也可能被 MySQL 服务器使用。

I hope this will help.

我希望这将有所帮助。

回答by Rodolpho Gurgel

This is a known Anaconda bug: From their Github:

这是一个已知的 Anaconda 错误:来自他们的 Github:

" I have fixed the underlying bug here but we will not release new Anaconda installers for a while.

“我在这里修复了潜在的错误,但我们暂时不会发布新的 Anaconda 安装程序。

The fix is in the latest Miniconda installers:

修复程序位于最新的 Miniconda 安装程序中:

64-bit: https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exehttps://repo.continuum.io/miniconda/Miniconda2-latest-Windows-x86_64.exe

64 位:https: //repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe https://repo.continuum.io/miniconda/Miniconda2-l​​atest-Windows-x86_64.exe

32-bit: https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exehttps://repo.continuum.io/miniconda/Miniconda2-latest-Windows-x86.exe

32 位:https: //repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe https://repo.continuum.io/miniconda/Miniconda2-l​​atest-Windows-x86.exe

Install those, then run the Anaconda Prompt and install whatever packages you need. If you want the latest full Anaconda release then use:

安装这些,然后运行 ​​Anaconda Prompt 并安装您需要的任何软件包。如果您想要最新的完整 Anaconda 版本,请使用:

conda install anaconda=5.0.1"

conda 安装 anaconda=5.0.1"

Check this github thread for the full answer: https://github.com/conda/conda/issues/6053

检查此 github 线程以获取完整答案:https: //github.com/conda/conda/issues/6053

回答by compie

I had the same issue and solved it like this:

我遇到了同样的问题并像这样解决了它:

  1. Open a command prompt (cmd.exe)
  2. Execute these commands to reset two environment variables:

    set PYTHONPATH= set PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

  3. Start the installer (from within the same command prompt).

  4. Now the installation will succeed!
  1. 打开命令提示符 (cmd.exe)
  2. 执行这些命令来重置两个环境变量:

    set PYTHONPATH= set PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

  3. 启动安装程序(从同一命令提示符中)。

  4. 现在安装将成功!

Tip: if 'Anaconda Prompt' in the start menu isn't working afterwards, use this workaround: C:\Users\<username>\AppData\Local\Continuum\anaconda3\Scripts\activate.bat C:\Users\<username>\AppData\Local\Continuum\anaconda3

提示:如果之后开始菜单中的“Anaconda Prompt”不起作用,请使用以下解决方法: C:\Users\<username>\AppData\Local\Continuum\anaconda3\Scripts\activate.bat C:\Users\<username>\AppData\Local\Continuum\anaconda3

回答by Jonathan Bartosh

When you installing Anaconda3 on Windows 10 and the Anaconda Navigator menu item does not install, and running the Anaconda Prompt gives the activate.bat error.

当您在 Windows 10 上安装 Anaconda3 并且 Anaconda Navigator 菜单项未安装时,运行 Anaconda Prompt 会出现 activate.bat 错误。

  1. Delete all instances of the previous python IDEs
  2. Reveal hidden files within the control menu
  3. Go to -> C:\Users[Username] in windows explorer
  4. Delete the files .conda and .anaconda. Possibly others if you had other IDEs.
  5. Go to -> C:\Users[Username]\AppData\Local
  6. Delete all python related files conda, python, ect.. any instances other python IDEs
  7. Go to -> C:\Users[Username]\AppData\Roaming
  8. Delete all python related files conda, python, ect.. any instances other python IDEs
  9. Run the Anaconda installer as Admin and install in a directory such as C:\anaconda3
  10. Sit back and wonder why an install took 4 hours out of my life and start drinking.
  1. 删除以前的python IDE的所有实例
  2. 显示控制菜单中的隐藏文件
  3. 在 Windows 资源管理器中转到 -> C:\Users[用户名]
  4. 删除文件 .conda 和 .anaconda。如果您有其他 IDE,可能还有其他人。
  5. 转到 -> C:\Users[用户名]\AppData\Local
  6. 删除所有与 python 相关的文件 conda、python 等 .. 其他 python IDE 的任何实例
  7. 转到 -> C:\Users[用户名]\AppData\Roaming
  8. 删除所有与 python 相关的文件 conda、python 等 .. 其他 python IDE 的任何实例
  9. 以管理员身份运行 Anaconda 安装程序并安装在 C:\anaconda3 等目录中
  10. 坐下来想知道为什么安装花了我 4 个小时的时间然后开始喝酒。

At some point I felt like this was a test for the uninitiated... can I start coding now?

在某些时候,我觉得这是对初学者的测试……我现在可以开始编码吗?

回答by sukbu

I solved it

我解决了

If you install other python directories or install anaconda on your drive. remove them all

如果您在驱动器上安装其他 python 目录或安装 anaconda。全部删除

and visit to C:\Users\<username>and you can find this babies

并访问C:\Users\<username>,你可以找到这个婴儿

.anaconda

.conda

.anaconda

.conda

Kill them all, reinstall anaconda.

全部杀掉,重新安装anaconda。

Now it works well.

现在它运作良好。

回答by Efdeel

I solved it with:
0. Rename/delete previous Anaconda3 directory (at c:\ProgramData\Anac...)
 (show/check hidden items at File Manager to delete it)
1. Re-install Anaconda
2. At Advanced Installation Options, I check both:
  2.1. [check] Add Anaconda to my PATH environment variable
  2.2. [check] Register Anaconda as my default Python 3.6
3. then click Install button
4. Done

my OS: windows 10, 64bit

我解决了它:
0. 重命名/删除以前的 Anaconda3 目录(在 c:\ProgramData\Anac...)
 (在文件管理器中显示/检查隐藏的项目以删除它)
1. 重新安装 Anaconda
2. 在高级安装选项,我检查两个:
  2.1。[检查] 将 Anaconda 添加到我的 PATH 环境变量
  2.2。[检查] 将 Anaconda 注册为我的默认 Python 3.6
3. 然后单击安装按钮
4. 完成

我的操作系统:windows 10, 64bit

回答by Aaron

I have met exactly the same problem when I was using anaconda 5.3.1 on windows10.

我在 windows10 上使用 anaconda 5.3.1 时遇到了完全相同的问题。

Well, the solution is to uninstall your anaconda and re-install it. And when you install anaconda, you can't close the exe command window manually which would show up at the end of installing. You should let it run and exit by itself. Only by this way your anaconda would be installed correctly.

好吧,解决方案是卸载您的anaconda并重新安装它。并且当您安装 anaconda 时,您无法手动关闭 exe 命令窗口,该窗口会在安装结束时显示。您应该让它自行运行并退出。只有这样,您的 anaconda 才能正确安装。

回答by shikha singh

I uninstalled any previous versions.Restarted system and installed Anaconda again at path C:\Users\xyzuser\Anaconda.It is working now

我卸载了任何以前的版本。重新启动系统并在路径 C:\Users\xyzuser\Anaconda 中再次安装 Anaconda。它现在正在工作

回答by soldy

The Fix is simple. Here's what you need to do. Go to--

修复很简单。这是您需要做的。去 -

C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\Scripts\

*Replace USERNAME with your own***

*用你自己的替换用户名***

If you are not able to access this location, then directly search in your C drive for Continuum, and from there you can write the rest of the URL

如果您无法访问此位置,则直接在 C 驱动器中搜索 Continuum,然后您可以从那里编写 URL 的其余部分

Search for "Activate.bat" If you are able to find this file, then go to ANACONDA PROMPT and Change your directory by typing:

搜索“Activate.bat”如果您能够找到此文件,请转到 ANACONDA PROMPT 并键入以下内容更改您的目录:

cd C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\Scripts\

*Replace USERNAME with your own***

*用你自己的替换用户名***

Your directory is now projecting to this new location.

您的目录现在正在投影到这个新位置。

Now type:

现在输入:

activate.bat

Hit enter

按回车

Now you activated your Anaconda.

现在你激活了你的 Anaconda。

Now, you can check if it is working or not by typing

现在,您可以通过键入来检查它是否正常工作

Conda list