Linux pip install problems

linux-pip-install-problems

I am not sure why this happens but each time i install a new linux system and i try to pip install a pythonlibrary i am getting the following warning/error message:

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.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

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

So if you are having the same problem, here is how to fix it:

First of all make sure you have Pip installed for your linux. Here i’ll go with Ubuntu, you can change the command line according to your Linux system:


$ sudo apt update
$ sudo apt install python3-pip

Now check to verify the installation of Pip:

pip3 –version

You’re ready to fix the problem for installing modules/librarires for Python. Type the following to your terminal:

$ python3 -m pip config set global.break-system-packages true

You can now install pip packages however use it carefully as there is always a chance to break your linux system!

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
hack4bengal-college-edition

Hack4Bengal College Edition

Next Post
automating-snowflake-resource-deployment-using-terraform-and-github-actions

Automating Snowflake Resource Deployment using Terraform and GitHub Actions

Related Posts