搜索网络,这似乎是由Python安装路径中的空格引起的问题。

我如何让pip工作,而不必重新安装在一个没有空格的路径中的所有东西?


当前回答

我将python.exe的可执行文件重命名为例如python27.exe。关于Archimedix的答案,我用十六进制编辑器打开我的pip.exe,滚动到文件的末尾,并将路径中的python.exe更改为python27.exe。在编辑make shure时,不重写其他信息。

其他回答

这对我很有效

python -m pip install --upgrade --force-reinstall pip

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

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

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

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

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

D:\Program Files (x86)\Python27\Scripts\pip.exe安装-r requirements.txt "D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt" Python27\Scripts\pip.exe安装-r requirements.txt "Python27/Scripts/pip.exe install -r requirements.txt"

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

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

第二步:进入命令提示符,打开oddo安装路径。

第三步:运行此命令python -m pip install XXX将运行并安装的东西。

尝试使用下面的链接重新安装,

下载https://bootstrap.pypa.io/get-pip.py

下载后,将“get-pip.py”复制到python安装的主目录,然后打开cmd并导航到python目录并键入“python get-pip.py”(不带引号)

注意:还要确保在环境变量中设置了python目录。

希望这能有所帮助。

我有这个问题,这个页面上的其他修复并没有完全解决这个问题。

解决问题的方法是进入我的系统环境变量并查看PATH -我已经卸载了Python 3,但Python 3文件夹的旧路径仍然在那里。我在我的PC上只运行Python 2,并使用Python 2安装pip。

从PATH中删除对不存在的Python 3文件夹的引用,并升级到pip的最新版本,解决了这个问题。

我写了一个脚本补丁那些exe。但最好的办法是修复distutil本身。

"""Fix "Fatal error in launcher: Unable to create process using ..." error. Put me besides those EXE made by pip. (They are made by distutils, and used by pip)"""
import re
import sys
import os
from glob import glob


script_path = os.path.dirname(os.path.realpath(__file__))
real_int_path = sys.executable
_t = script_path.rpartition(os.sep)[0] + os.sep + 'python.exe'
if script_path.lower().endswith('scripts') and os.path.isfile(_t):
    real_int_path = _t

print('real interpreter path: ' + real_int_path)
print()

for i in glob('*.exe'):
    with open(i, 'rb+') as f:
        img = f.read()
        match = re.search(rb'#![a-zA-Z]:\\.+\.exe', img)
        if not match:
            print("can't fix file: " + i)
            continue
        int_path = match.group()[2:].decode()
        int_path_start = match.start() + 2
        int_path_end = match.end()

        if int_path.lower() == real_int_path.lower():
            continue
        print('fix interpreter path: %s in %s' % (int_path, i))
        f.seek(int_path_start)
        f.write(real_int_path.encode())
        f.write(img[int_path_end:])