简体   繁体   English

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

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

I have downloaded Anaconda3 for windows 64-bit operating system.我已经为 Windows 64 位操作系统下载了 Anaconda3。 After the download and install completed, I opened the Anaconda prompt but it give me this nice error:下载和安装完成后,我打开了 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.我刚刚在网上冲浪,找到了卸载以前所有python包的解决方案,但没有用。 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.我在我的系统中搜索了 activate.bat 文件“在 anaconda 目录的一个文件夹中找到它”并将其复制、粘贴到 Scripts 文件夹,但它给了我 conda 包和依赖项的错误。 Any solutions please!!请问有什么解决办法!!
I cannot run any either jupyter notebook or conda as well.我也无法运行任何 jupyter notebook 或 conda。 Actually, I do not know how to find them in those bunch of Anaconda files and packages.实际上,我不知道如何在那些 Anaconda 文件和包中找到它们。

Thanks in advance,,,.提前致谢,,,。

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.exe https://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.exe https://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.安装这些,然后运行 ​​Anaconda Prompt 并安装您需要的任何软件包。 If you want the latest full Anaconda release then use:如果您想要最新的完整 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

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

At some point I felt like this was a test for the uninitiated... can I start coding now?在某些时候,我觉得这是对初学者的测试……我现在可以开始编码吗?

I think the problem will be solved by clearing all dependencies.我认为问题将通过清除所有依赖项来解决。
I initially had python installed, 2.7 and 3.6.我最初安装了 python,2.7 和 3.6。 I just get rid of all of them.我只是摆脱了他们。 The problem is not solved yet.问题还没有解决。

I discovered that My MySQL server is running.我发现我的 MySQL 服务器正在运行。 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. Anaconda 需要监听,我认为 8888 端口,它也可能被 MySQL 服务器使用。

I hope this will help.我希望这会有所帮助。

I had the same issue and solved it like this:我遇到了同样的问题并像这样解决了它:

  1. Open a command prompt (cmd.exe)打开命令提示符 (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!现在安装将成功!

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

I solved it我解决了

If you install other python directories or install anaconda on your drive.如果您在驱动器上安装其他 python 目录或安装 anaconda。 remove them all全部删除

and visit to C:\\Users\\<username> and you can find this babies并访问C:\\Users\\<username>你可以找到这个宝贝

.anaconda .anaconda

.conda .conda

Kill them all, reinstall anaconda.全部杀掉,重新安装anaconda。

Now it works well.现在它运作良好。

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

I solved it with:我用以下方法解决了它:
0. Rename/delete previous Anaconda3 directory (at c:\\ProgramData\\Anac...) 0. 重命名/删除以前的 Anaconda3 目录(在 c:\\ProgramData\\Anac...)
(show/check hidden items at File Manager to delete it) (在文件管理器中显示/检查隐藏项目以将其删除)
1. Re-install Anaconda 1.重新安装Anaconda
2. At Advanced Installation Options, I check both: 2.在高级安装选项,我检查两个:
2.1. 2.1. [check] Add Anaconda to my PATH environment variable [检查] 将 Anaconda 添加到我的 PATH 环境变量
2.2. 2.2. [check] Register Anaconda as my default Python 3.6 [检查] 将 Anaconda 注册为我的默认 Python 3.6
3. then click Install button 3.然后点击安装按钮
4. Done 4. 完成

my OS: windows 10, 64bit我的操作系统:Windows 10,64 位

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.好吧,解决方案是卸载您的anaconda并重新安装它。 And when you install anaconda, you can't close the exe command window manually which would show up at the end of installing.并且当您安装 anaconda 时,您无法手动关闭 exe 命令窗口,该窗口会在安装结束时显示。 You should let it run and exit by itself.您应该让它自行运行并退出。 Only by this way your anaconda would be installed correctly.只有这样,您的 anaconda 才能正确安装。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM