Python Anaconda“无法创建进程”

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

Anaconda "failed to create process"

pythonwindowsanaconda

提问by khuongngoc

I am a newbie to Python. I just installed Python (anaconda python 2.7) and while launching Anaconda prompt something happened which was "failed to create process"

我是 Python 的新手。我刚刚安装了 Python(anaconda python 2.7),在启动 Anaconda 时提示发生了一些“无法创建进程”的事情

enter image description here

在此处输入图片说明

So can anyone here help me out please? I appriciate every help.

所以这里有人可以帮我吗?我感谢每一个帮助。

回答by Benji

I encountered the exact same error, because my username included a space. ("C:\Users\Ben Ji") The easiest solution is to install Anaconda to another folderin the Users-folder, e.g. public.

我遇到了完全相同的错误,因为我的用户名包含一个空格。("C:\Users\Ben Ji") 最简单的解决方案是将 Anaconda 安装到用户文件中的另一个文件夹,例如 public。

(The same error occurs when using pip, check out https://stackoverflow.com/a/35275384/6580199)

(使用pip时出现同样的错误,查看https://stackoverflow.com/a/35275384/6580199

回答by Frank M

Anaconda uses an executable that starts Python with a script. The executable retrieves its own name, strips off ".exe" and post-pends "-script.py". In that script file, check the first line of the script corresponding to the command. It should have a she-bang pointing at the correct Python executable, something like:

Anaconda 使用一个通过脚本启动 Python 的可执行文件。可执行文件检索它自己的名称,去掉“ .exe”并附加“ -script.py”。在该脚本文件中,检查与命令对应的脚本的第一行。它应该有一个指向正确的 Python 可执行文件的 she-bang,例如:

#!C:/ProgramData/Anaconda3/python.exe

You can use forward and back slashes interchangeably in this line. If the link points to the wrong place, you'll get "failed to create process." If the link needs spaces, you can put it in double-quotes, like this:

您可以在此行中交替使用正斜杠和反斜杠。如果链接指向错误的地方,您将得到“无法创建进程”。如果链接需要空格,您可以将其放在双引号中,如下所示:

#!"C:/Users/My special name/my special place/python.exe"

Single quotes and back slash escape on spaces don't seem to work for the executable path,... go figure.

空格上的单引号和反斜杠转义似乎不适用于可执行路径,......去图。

Note that if you don't coordinate the name of the executable file with the name of the script, you'll get a "Cannot open" error rather than "failed to create process."

请注意,如果您不将可执行文件的名称与脚本名称协调,您将收到“无法打开”错误而不是“无法创建进程”。

回答by Shravankumar Hiregoudar

I tried the above methods, but it didn't work. Then I uninstalled and reinstalled the anaconda. Now, It works fine.

我尝试了上述方法,但没有奏效。然后我卸载并重新安装了anaconda。现在,它工作正常。

回答by addcolor

I tried installing as administrator and it worked. Right click on installer and 'Run as administrator'.

我尝试以管理员身份安装,它奏效了。右键单击安装程序并“以管理员身份运行”。