Install python selenium

I want to install a library named selenium for web scrapping purpose. if I install it using pipenv on a virtual environment then it can’t access my web browser.

So I want to install it globally.

When I type

pip install selenium

Output in terminal

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
python-xyz', where xyz is the package you are trying to

If you wish to install a non-Arch-packaged Python package,
create a virtual environment using 'python -m venv path/to/venv'.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.

If you wish to install a non-Arch packaged Python application,
it may be easiest to use 'pipx install xyz', which will manage a
virtual environment for you. Make sure you have python-pipx
installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

When I try to install using pacman . These are the outputs.

any help??

I believe the error message it’s throwing is pretty straight forward…?

sudo pacman -S python-pipx
pipx install selenium

In future, try searching AUR as well using paru.
The AUR version is marked out of date. So use the one provided by PyPI.

aur/python-selenium 4.12.0-1 [+21 ~1.57] [Out-of-date: 2023-10-17]
    Python language bindings for Selenium WebDriver

In addition to what @NaN said , i actually like to create virtual environment , just create a directory with any name and run inside it:

python -m venv

Then every thing related to pip / pip3 can run with no issue at all inside this directory , and can be accessible outside it as well , so its just perfection .


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.