【问题标题】:RuntimeError: Python version >= 3.5 required while installing the python librariesRuntimeError:安装 python 库时需要 Python 版本 >= 3.5
【发布时间】:2025-12-27 08:50:16
【问题描述】:

我正在使用虚拟环境。 因为我有一个 python 版本3.7.0

virtualenv --python=python3.7 .env

现在,每当我尝试在那里安装任何库时,它都会给我这个错误

Downloading/unpacking scikit-learn==0.20.2
  Running setup.py (path:/tmp/pycharm-packaging421/scikit-learn/setup.py) egg_info for package scikit-learn
    Partial import of sklearn during the build process.

Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/local/lib/python3.4/dist-packages (from scikit-learn==0.20.2)
Downloading/unpacking scipy>=0.13.3 (from scikit-learn==0.20.2)
  Running setup.py (path:/tmp/pycharm-packaging421/scipy/setup.py) egg_info for package scipy
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pycharm-packaging421/scipy/setup.py", line 31, in <module>
        raise RuntimeError("Python version >= 3.5 required.")
    RuntimeError: Python version >= 3.5 required.
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pycharm-packaging421/scipy/setup.py", line 31, in <module>

    raise RuntimeError("Python version >= 3.5 required.")

RuntimeError: Python version >= 3.5 required.

谁能帮我解决这个问题?

【问题讨论】:

  • 您的系统上是否安装了 Python 3.7?当你激活环境并运行python --version时会发生什么,它真的显示3.7吗?
  • 是的,我已经安装了。

标签: python python-3.x pandas numpy scikit-learn


【解决方案1】:

要在旧版本的python3中使用virtualenv,请使用此方法。

创建: python3 -m venv .venv

激活: source .venv/bin/activate

退出: deactivate

我在 Debian 8.11 中的 Python 3.4.2 上对其进行了测试

【讨论】: