搜索网络,这似乎是由Python安装路径中的空格引起的问题。
我如何让pip工作,而不必重新安装在一个没有空格的路径中的所有东西?
搜索网络,这似乎是由Python安装路径中的空格引起的问题。
我如何让pip工作,而不必重新安装在一个没有空格的路径中的所有东西?
当前回答
我在windows 10上也有同样的问题,在尝试了之前所有的解决方案后,问题仍然存在,所以我决定卸载我的python 2.7并安装2.7.13版本,它工作得很好。
其他回答
我写了一个脚本补丁那些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:])
我试图安装一些站点包,如numpy, xgboost等,但每次都出现这个错误:
Fatal error in launcher: Unable to create process using
我尝试了很多方法来解决这个问题,并找到了这个方法,它成功地帮助了我:
python -m pip freeze
希望它也能帮助到别人。
附:我在这里找到了这个解决方案:https://stackoverflow.com/a/39733705/10310794
请加上这个地址:
C:\Program Files (x86)\Python33
Windows中的PATH变量
尽管首先要确保这是Python exe文件所在的文件夹,然后只将此路径添加到path变量中。
要在PATH变量中添加地址,请转到
控制面板->系统->高级系统设置->环境 变量—>系统变量—>路径—>编辑—> . zip
然后添加上面提到的路径&单击保存
它不是直接调用ipython,而是使用Python加载,例如
“ipython.exe的完整路径”
我也有同样的问题,并使用以下进行了PIP升级,现在它工作正常。 Python -m PIP install——升级PIP