I have run into this numerous times on my current project and it's driving me crazy. I discover I need to install some module but get an error that pip 6.1.1 isn't installed (server has 8.1.2):
$ sudo pip install djangorestframework
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2991, in <module>
@_call_aside
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2977, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 664, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 677, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 856, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==6.1.1' distribution was not found and is required by the application
so I checked:
$ pip --version
pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
I have tried $ sudo yum install djangorestframework
but the package doesn't exist (no surprise). how do install these things that seem to rely specifically on 6.1.1 but I have 8.1.2? I'm worried if I uninstall (and rollback) that I'll loose functionality in other areas...
It occurred to me it's a difference between the sudo
in the first command and lack of it in the second, so I tried this:
$ sudo yum install python-pip
Loaded plugins: priorities, update-motd, upgrade-helper
Package python26-pip-6.1.1-1.23.amzn1.noarch already installed and latest version
Nothing to do
[ec2-user@ip-172-XX-XX-XXX limboproj]$ source limboenv/bin/activate
(limboenv)[ec2-user@ip-172-XX-XX-XXX limboproj]$ sudo yum install python-pip
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
Package python26-pip-6.1.1-1.23.amzn1.noarch already installed and latest version
Nothing to do
and I still get:
$ sudo pip --version
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2991, in <module>
@_call_aside
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2977, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3004, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 664, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 677, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 856, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==6.1.1' distribution was not found and is required by the application
SO labelled as a duplicate, so I'm including here my comment below. when I tried to follow the answer on the suggested question, I got:
$ sudo pip install --upgrade pip-6.1.1
which results in a stacktrace ending with:
The 'pip==6.1.1' distribution was not found and is required by the application. also notice in my edit, i show that sudo yum install python-pip seems to conflict with sudo pip --version