当我尝试安装任何库时出现运行时错误(需要 python 3.5 或更高版本)

问题描述 投票:0回答:2

我正在尝试安装一些库以在 python 3.4 上使用,但每次运行 pip install ("name of library") 时,它都会返回以下错误:

Collecting pyautogui
  Using cached https://files.pythonhosted.org/packages/35/71/a7d328fe19667777fb0c371ca346c89d1b380f7778fa1ba65aca1090478c/PyAutoGUI-0.9.49.tar.gz
  Exception:
  Traceback (most recent call last):
    File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main
      status = self.run(options, args)
    File "C:\Python34\lib\site-packages\pip\commands\install.py", line 339, in run
      requirement_set.prepare_files(finder)
    File "C:\Python34\lib\site-packages\pip\req\req_set.py", line 385, in prepare_files
      req_to_install.run_egg_info()
    File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 310, in run_egg_info
      self.setup_py, self.name,
    File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 281, in setup_py
      import setuptools  # noqa
    File "C:\Python34\lib\site-packages\setuptools\__init__.py", line 17, in <module>
      import setuptools.version
    File "C:\Python34\lib\site-packages\setuptools\version.py", line 1, in <module>
      import pkg_resources
    File "C:\Python34\lib\site-packages\pkg_resources\__init__.py", line 93, in <module>
      raise RuntimeError("Python 3.5 or later is required")
  RuntimeError: Python 3.5 or later is required
python python-3.x pip pyautogui
2个回答
0
投票

您看到这一点是因为 pip 19.2 放弃了对 Python 3.4 的支持

好消息:

get-pip.py
脚本已更新以包含特定于 3.4 的选项。您可以使用以下命令请求 pip 19.1,这是支持 Python 3.4 的最后一个 pip 版本:

python get-pip.py pip==19.1

0
投票

这里最好的选择是(如果可以的话)升级到受支持的 python 版本,请参阅 https://endoflife.date/python 以获取当前支持的 python 版本列表

© www.soinside.com 2019 - 2024. All rights reserved.