Pip - 启动器中的致命错误:无法使用“”创建进程

新手上路,请多包涵

我通过 ampps 安装了 python 3.5.1,它正在工作。但是,当我尝试使用 pip 时,我收到以下消息:

 Fatal error in launcher: Unable to create process using '"'

我已经将 ampps 重新安装到不包含任何空格的路径中。请注意,“python -m pip”解决方法也不适用于我,因为我每次使用它时都会收到以下消息:

 C:\Users\MyUserName\Desktop\Ampps\python\python.exe: Error while finding spec for 'pip.__main__' (<class 'ImportError'>: No module named 'queue'); 'pip' is a package and cannot be directly executed

如何让 pip 正常工作?我希望,有一种方法可以在没有前面的 python 命令的情况下使用 pip 命令本身。

编辑:如果我尝试运行 python -c "import pip.__main__" 会发生这种情况:

 Traceback (most recent call last):
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\compat__init__.py", line 11, in <module>
    from logging.config import dictConfig as logging_dictConfig
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\logging\config.py", line 30, in <module>
    import logging.handlers
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\logging\handlers.py", line 28, in <module>
    import queue
ImportError: No module named 'queue'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip__init__.py", line 13, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\utils__init__.py", line 18, in <module>
    from pip.compat import console_to_str, stdlib_pkgs
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\compat__init__.py", line 13, in <module>
    from pip.compat.dictconfig import dictConfig as logging_dictConfig
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\site-packages\pip\compat\dictconfig.py", line 22, in <module>
    import logging.handlers
  File "C:\Users\MyUserName\Desktop\Ampps\python\lib\logging\handlers.py", line 28, in <module>
    import queue
ImportError: No module named 'queue'

原文由 nichoio 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 2.3k
2 个回答

我通过…解决了我的问题

  1. 在官网下载 Python 3 并通过 express 安装进行安装
  2. 将独立 python 复制并粘贴到 ampps/python 文件夹中并覆盖 AMPPS 提供的 python 版本
  3. 在cmd中运行 python -m pip install --upgrade pip

现在 pip 和 python 3 已安装在其最新版本中。

AMPPS 似乎没有提供成熟的 python 构建。所以你需要自己更新python。

谢谢大家。

原文由 nichoio 发布,翻译遵循 CC BY-SA 3.0 许可协议

这在 Windows 10 x64 下对我有用:

确保 Python 目录在路径 中,例如:

 # Edit Environment variables so that variable "path" points to the new location.
# Insert these at the start of the list (or delete other Python directories), as Windows takes the first match it finds.
# Type "Win-S" then search for "Edit the System Environment Variables".
# Or see Control Panel under "System Properties".
S:\Research\bin\Python375\Scripts\
S:\Research\bin\Python375\

然后:

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

在我的特殊情况下,错误是由将 Python 目录移动到新位置引起的。

原文由 Contango 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题