启动器中的致命错误:无法使用“C:\Program Files (x86)\Python33\python.exe”“C:\Program Files (x86)\Python33\pip.exe”创建进程

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

Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""

pythonpip

提问by Archimedix

Searching the net this seems to be a problem caused by spaces in the Python installation path.

网上搜了一下,这个好像是python安装路径有空格导致的问题。

How do I get pipto work without having to reinstall everything in a path without spaces ?

如何pip开始工作而不必在没有空格的路径中重新安装所有内容?

采纳答案by user4154243

it seems that

看起来

python -m pip install XXX 

will work anyway (worked for me) (see link by user474491)

无论如何都会工作(为我工作)(见user474491 的链接

回答by Archimedix

On Windows at least, pipstores the execution path in the executable pip.exewhen it is installed.

至少在 Windows 上,安装时pip将执行路径存储在可执行文件中pip.exe

Edit this file using a hex editor or WordPad (you have to save it as plain text then to retain binary data), change the path to Python with quotes and spaces like this:

使用十六进制编辑器或写字板编辑此文件(您必须将其保存为纯文本,然后保留二进制数据),使用引号和空格更改 Python 的路径,如下所示:

#!"C:\Program Files (x86)\Python33\python.exe"

to an escaped path without spaces and quotes and pad with spaces (dots at the end should be spaces):

到没有空格和引号并用空格填充的转义路径(末尾的点应该是空格):

#!C:\Progra~2\Python33\python.exe.............

For "C:\Program Files", this path would probably be "C:\Progra~1" (shortened path names in DOS / Windows 3.x notation use tilde and numbers). Windows provides this alternative notation for backwards compatibility with DOS / Windows 3.x apps.

对于“C:\Program Files”,此路径可能是“C:\Progra~1”(DOS / Windows 3.x 表示法中的缩写路径名使用波浪号和数字)。Windows 提供了这种替代表示法,以便与 DOS / Windows 3.x 应用程序向后兼容。

Note that as this is a binary file, you should not change the file size which may break the executable, hence the padding.

请注意,由于这是一个二进制文件,因此您不应更改可能破坏可执行文件的文件大小,从而导致填充。

Save with administrator privileges, make sure it is actually saved at the target location and try again.

使用管理员权限保存,确保它确实保存在目标位置,然后重试。

You might also need to set the PATHvariable to use the ~notation for the path to pip.

您可能还需要设置PATH变量使用~符号的路径pip

回答by apple16

Here's how I solved it:

这是我解决它的方法:

  1. open pip.exein 7zip and extract __main__.pyto Python\Scripts folder.

    In my case it was C:\Program Files (x86)\Python27\Scripts

  2. Rename __main__.pyto pip.py

  3. Run it! python pip.py install something

  1. pip.exe在 7zip 中打开并解压缩__main__.py到 Python\Scripts 文件夹。

    就我而言,它是 C:\Program Files (x86)\Python27\Scripts

  2. 重命名__main__.pypip.py

  3. 运行! python pip.py install something

EDIT:

编辑:

If you want to be able to do pip install somethingfrom anywhere, do this too:

如果您希望能够pip install something从任何地方进行,也可以这样做:

  1. rename pip.py to pip2.py (to avoid import pip errors)

  2. make C:\Program Files (x86)\Python27\pip.batwith the following contents:

  1. 将 pip.py 重命名为 pip2.py(以避免导入 pip 错误)

  2. 使C:\Program Files (x86)\Python27\pip.bat具有以下内容:

python "C:\Program Files (x86)\Python27\Scripts\pip2.py" %1 %2 %3 %4 %5 %6 %7 %8 %9

python "C:\Program Files (x86)\Python27\Scripts\pip2.py" %1 %2 %3 %4 %5 %6 %7 %8 %9

  1. add C:\Program Files (x86)\Python27to your PATH (if is not already)

  2. Run it! pip install something

  1. 添加C:\Program Files (x86)\Python27到您的 PATH (如果还没有)

  2. 运行! pip install something

回答by user474491

This is a known Bugwhen there is a space in the virtualenvpath. Correction has been made, and will be available in the next version.

当路径中有空格时,这是一个已知的错误virtualenv。已进行更正,并将在下一个版本中提供。

回答by MiguelCldn

having the same trouble I read in https://pip.pypa.io/en/latest/installing.html#install-pipthat to update pip it's:

有同样的麻烦,我在https://pip.pypa.io/en/latest/installing.html#install-pip中读到更新 pip 它是:

python -m pip install -U pip

python -m pip install -U pip

So I made (for example)

所以我做了(例如)

python -m pip install virtualenv

python -m pip install virtualenv

And it worked! So you can do the same being 'virtualenv' another package you want.

它奏效了!所以你可以做同样的“virtualenv”另一个你想要的包。

回答by Samik Banerjee

Please add this address :

请添加此地址:

C:\Program Files (x86)\Python33

C:\Program Files (x86)\Python33

in Windows PATH Variable

在 Windows PATH 变量中

Though first make sure this is the folder where Python exe file resides, then only add this path to the PATH variable.

虽然首先确保这是 Python exe 文件所在的文件夹,然后只将此路径添加到 PATH 变量。

To append addresses in PATH variable, Please go to

要在 PATH 变量中附加地址,请转到

Control Panel -> Systems -> Advanced System Settings -> Environment Variables -> System Variables -> Path -> Edit ->

控制面板 -> 系统 -> 高级系统设置 -> 环境变量 -> 系统变量 -> 路径 -> 编辑 ->

Then append the above mentioned path & click Save

然后附加上面提到的路径并点击保存

回答by Stephen Kim

Instead of calling ipython directly, it is loaded using Python such as

不是直接调用 ipython,而是使用 Python 加载,例如

$ python "full path to ipython.exe"

$ python "ipython.exe 的完整路径"

回答by Markus Weber

I renamedthe executable of python.exeto e.g. python27.exe. In respect to the answer of ArchimedixI opened my pip.exe with a Hex-Editor, scrolled to the end of the file and changed the python.exein the path to python27.exe. While editing make shure you don't override other informations.

我将可执行文件重命名python.exe为 eg python27.exe。关于Archimedix的答案,我用Hex-Editor打开了我的 pip.exe ,滚动到文件的末尾python.exe并将路径中的python27.exe. 在编辑时确保您不要覆盖其他信息。

回答by Ajay2707

I added my anwer because I have getting the same error while configure ODDO9 source code in local and its need the exe to run while run exe, I got the same error.

我添加了我的答案,因为我在本地配置 ODDO9 源代码时遇到了同样的错误,并且它需要在运行 exe 时运行 exe,我遇到了同样的错误。

From yesterday I was configure oddo 9.0(section :- "Python dependencies listed in the requirements.txt file.") and its need to run PIP exe as

从昨天开始,我配置了oddo 9.0(部分:-“requirements.txt 文件中列出的Python 依赖项。”)并且它需要运行PIP exe 作为

C:\YourOdooPath> C:\Python27\Scripts\pip.exe install -r requirements.txt

C:\YourOdooPath> C:\Python27\Scripts\pip.exe install -r requirements.txt

My oddo path is :- D:\Program Files (x86)\Odoo 9.0-20151014 My pip location is :- D:\Program Files (x86)\Python27\Scripts\pip.exe

我的奇怪路径是:- D:\Program Files (x86)\Odoo 9.0-20151014 我的 pip 位置是:- D:\Program Files (x86)\Python27\Scripts\pip.exe

So I open command prompt and go to above oddo path and try to run pip exe with these combination, but not given always above error.

所以我打开命令提示符并转到上面的oddo路径并尝试使用这些组合运行pip exe,但并不总是给出上述错误。

  1. D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt
  2. "D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt" Python27\Scripts\pip.exe install -r requirements.txt

  3. "Python27/Scripts/pip.exe install -r requirements.txt"

  1. D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt
  2. "D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt" Python27\Scripts\pip.exe install -r requirements.txt

  3. “Python27/Scripts/pip.exe install -r requirements.txt”

I resolved my issue by the @user4154243 answer, thanks for that.

我通过@user4154243 的回答解决了我的问题,谢谢。

Step 1: Add variable(if your path is not comes in variable's path).

第 1 步:添加变量(如果您的路径不在变量的路径中)。

Step 2: Go to command prompt, open oddo path where you installed.

第 2 步:转到命令提示符,打开您安装的 oddo 路径。

Step 3: run this command python -m pip install XXXwill run and installed the things.

第三步:运行这个命令python -m pip install XXX会运行并安装好东西。

回答by Joel K Thomas

python -m pip

蟒蛇 -m pip

really works for the problem Fatal error in launcher: Unable to create process using '"'.Worked on Windows 10

真的可以解决这个问题Fatal error in launcher: Unable to create process using '"'。 在 Windows 10 上工作