【问题标题】:Pip install: Error "No module named 'setuptools' "Pip 安装:错误“没有名为 'setuptools' 的模块”
【发布时间】:2018-05-24 08:09:02
【问题描述】:

我在 Windows 上安装 pyinstaller 时遇到问题。使用命令:

C:\Users\Chris>py -m pip install pyinstaller --user

我不断收到错误:

Collecting pyinstaller Using cached PyInstaller-3.3.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'setuptools' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users\Chris\Ap pData\Local\Temp\pip-build-jvfkrm8f\pyinstaller\

我已经尝试升级 setuptools

C:\Users\Chris>py -m pip install setuptools --upgrade Requirement already up-to-date: setuptools in c:\users\chris\lib\site-packages

我还尝试卸载并重新安装 setuptools。

我该如何解决这个问题?

【问题讨论】:

  • 如果它不会破坏您的环境,您可以尝试不使用 --user。和/或可能在 virtualenv 中。
  • 没有 --user 仍然失败。我将如何制作虚拟环境?
  • venv 是here,但如果你不想改变你的主要环境,我只是建议它。所以它不会解决任何关于 setuptools 的问题
  • 如果你只是启动python,import setuptools是否运行成功?
  • 它不会抛出任何错误,也没有附带的文本输出。之后尝试 pip install 仍然会引发与以前相同的错误。

标签: python windows pip pyinstaller setuptools


【解决方案1】:

尝试做

pip<py version> install pyinstaller --user

喜欢

pip3.6 install pyinstaller

【讨论】:

  • 同样的错误C:\Users\Chris&gt;pip3.6 install pyinstaller --user 文件“”,第 1 行,在 ModuleNotFoundError: No module named 'setuptools' --------------- ------------------------- 命令“python setup.py egg_info”在 C:\Users\Chris\AppData\Local 中失败,错误代码为 1 \Temp\pip-build-dafcvasf\pyinstaller`
猜你喜欢
  • 2017-08-26
  • 1970-01-01
  • 2018-04-20
  • 1970-01-01
  • 2022-07-30
  • 2018-10-29
  • 2018-07-12
  • 1970-01-01
  • 2014-12-23
相关资源
最近更新 更多