You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Linux环境Python2.7.14+执行python setup.py遇selenium安装错误求解决

Fixing "No matching distribution found for selenium" on Python 2.7

That error pops up because Selenium stopped supporting Python 2.7 starting with version 4.x. Since Python 2.7 reached its end-of-life in 2020, almost all modern packages (including Selenium) no longer maintain compatibility with it. Here are your two main options to resolve this:

Sticking with Python 2.7 means missing out on security patches, new features, and support for most modern libraries. Upgrading to Python 3 is the best long-term fix. Here's how to do it on Linux:

  • Install Python 3 and its package manager using your distribution's tools:
    • For Debian/Ubuntu-based systems:
      sudo apt update && sudo apt install python3 python3-pip
      
    • For RHEL/CentOS/Fedora:
      sudo dnf install python3 python3-pip
      
  • Once installed, use pip3 to install the latest Selenium:
    pip3 install selenium
    

Solution 2: Install an Older Selenium Version (If You Must Stay on Python 2.7)

If upgrading isn't an option right now, you can install the last Selenium version that supports Python 2.7: 3.141.0. Here's how:

  • First, make sure you're using Python 2's pip (often called pip2):
    • Check if pip2 is available:
      pip2 --version
      
    • If not, install it:
      • Debian/Ubuntu: sudo apt install python-pip
      • RHEL/CentOS/Fedora: sudo dnf install python2-pip
  • Install the compatible Selenium version:
    pip2 install selenium==3.141.0
    

Keep in mind that Selenium 3.x won't get any security updates or new features anymore, so upgrading to Python 3 should be your priority whenever possible.

Content of the question originates from Stack Exchange, question author ValentinaPink

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:24:39