Fixing "pkg-resources==0.0.0" pip error on Ubuntu

I ran into this error when trying to pip install from a requirements.txt file on Ubuntu: No matching distribution found for pkg-resources==0.0.0. This line is added to the requirements.txt file (if you look in the file, you'll probably see it) by the pip that comes with Ubuntu's python-pip package (also I had created the requirements.txt file using pip freeze in a virtualenv). The solution to this problem was to first uninstall the Ubuntu version of pip:

sudo apt-get remove python-pip-whl python3-pip

Then install it using easy_install: 

# install easy_install if you don't already have it
sudo apt-get install python-setuptools

# install pip using easy_install
easy_install pip

# install virtualenv using pip
pip install virtualenv

# now you can recreate the requirements.txt file
# pip install whatever dependencies you have
pip freeze > requirements.txt

3 responses
pip3 install -r requirements.txt
sudo apt install libpq-dev python3-dev
1 visitor upvoted this post.