Python Pip broken with sys.stderr.write(f”ERROR: {exc}”)

We Are Going To Discuss About Python Pip broken with sys.stderr.write(f”ERROR: {exc}”). So lets Start this Python Article.

Python Pip broken with sys.stderr.write(f”ERROR: {exc}”)

  1. How to solve Python Pip broken with sys.stderr.write(f”ERROR: {exc}”)

    You can get an older version (2.7) of get-pip.py
    curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
    In my opinion, you should create a python2 virtualenv and install your python2 package in it, as well as pip2. For example, when I installed cuckoo sandbox, I did it like this:
    virtualenv --python=python2 cuckoo/ # make your virtualenv folder with python2 cd cuckoo source bin/activate curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py # get pip for python2 python2 get-pip.py # install pip in your virtualenv pip install cuckoo # install your python2 package
    Hope it will help.

  2. Python Pip broken with sys.stderr.write(f”ERROR: {exc}”)

    You can get an older version (2.7) of get-pip.py
    curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
    In my opinion, you should create a python2 virtualenv and install your python2 package in it, as well as pip2. For example, when I installed cuckoo sandbox, I did it like this:
    virtualenv --python=python2 cuckoo/ # make your virtualenv folder with python2 cd cuckoo source bin/activate curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py # get pip for python2 python2 get-pip.py # install pip in your virtualenv pip install cuckoo # install your python2 package
    Hope it will help.

Solution 1

You can get an older version (2.7) of get-pip.py

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py

In my opinion, you should create a python2 virtualenv and install your python2 package in it, as well as pip2. For example, when I installed cuckoo sandbox, I did it like this:

virtualenv --python=python2 cuckoo/   # make your virtualenv folder with python2
cd cuckoo
source bin/activate
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py   # get pip for python2
python2 get-pip.py        # install pip in your virtualenv
pip install cuckoo       # install your python2 package

Hope it will help.

Original Author basketmaker Of This Content

Solution 2

This problem has to do with the fact that Python 2.7 reached end of its life and that the PIP community dropped support for it this month.

PIP displays deprecation notices such as

DEPRECATION: Python 2.7 reached the end of its life on January 1st,
2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021.
More details about Python 2 support in pip can be found at
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
pip 21.0 will remove support for this functionality.

To fix this and continue with unsupported Python 2.7 you should not upgrade to the latest pip version but to a version < 21.

pip install --upgrade "pip < 21.0"

Original Author basketmaker Of This Content

Solution 3

As PIP dropped support for Python 2.7 in result we are facing the above mentioned issue, following are the commands which actually worked for me on Ubuntu.

sudo apt-get remove --purge python-pip
sudo apt-get autoremove
sudo rm -f /usr/local/bin/pip
sudo easy_install pip==20.3.4
pip --version

Output: pip 20.3.4

Same can be achieved for CentOS by changing package manager name.

Original Author gondaljutt Of This Content

Solution 4

Update: Please use following command to install the pip on python2.7

curl  https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py

Enjoy it!

Original Author W. Dan Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment