[Python] Installing an older version of selenium with Python3 on Ubuntu with an...

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I am on the following Ubuntu version on WSL

    Distributor ID: Ubuntu
    Description: Ubuntu 24.04.2 LTS
    Release: 24.04
    Codename: noble


    I am running Python 3.12.3

    I need to install selenium 4.2.0 or 4.2.1

    I have admin rights on the machine

    When I try to install the particular version

    $ sudo pip install selenium=4.2.0

    error: externally-managed-environment

    × This environment is externally managed
    ╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.


    (I am pasting only the relevant part of the error message)

    So next I tried the same using apt-get

    $sudo apt-get install python3-selenium=4.2.0

    Package python3-selenium is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Version '4.2.0' for 'python3-selenium' was not found


    How do I get this version for the python3-selenium package?

    Selenium website has the 4.2.0 package but then I would have to install it with pip which again give the managed environment error

    So how do I do this?

    Continue reading...

Compartilhe esta Página