I just wanted to install the lang package.
The problem here is that I have spent ages installing countless packages and don't want to do it all again. I'm no great expert at python package management and I'd rather not need to become one. This happened because I cut and pasted an answer from Stack Overflow in the naive hope that it was actually correct (see below).
Is there a way to simply remove the pip installation and keep the installed package information and then re-install pip3 again using the old package info?
I imagine that pip must keep the package info in some database, so possibly I can copy that out, re-install a fresh pip and then copy back the package data?
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ pip3 install lang
Collecting lang
Downloading lang-1.0.5.tar.gz (5.7 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python#3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/setup.py'"'"'; __file__='"'"'/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/pip-egg-info
cwd: /private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/setup.py", line 14, in <module>
with open(path.join(here, '..', 'README.md'), encoding='utf-8') as f:
File "/usr/local/Cellar/python#3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py", line 905, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/../README.md'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
(That's weird how am I supposed to fix that? Maybe pip is out of date? I don't remember the upgrade command so I'll just get it from Stack Overflow.)
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ sudo -H pip3 install --upgrade pip
(It's totally not obvious that it's not going to upgrade the right version of pip and that's going to break everything.)
Password:
Collecting pip
Downloading pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 1.7 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
Successfully uninstalled pip-20.0.2
Successfully installed pip-20.2.2
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ sudo -H pip3 install --upgrade pip3
(Maybe it's supposed to be pip3 that should have been upgraded here?)
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 20.2.2 (/usr/local/lib/python3.8/site-packages), Requirement.parse('pip==20.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/opt/python#3.8/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ pip3 install lang
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 20.2.2 (/usr/local/lib/python3.8/site-packages), Requirement.parse('pip==20.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/opt/python#3.8/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ which pip
/usr/local/bin/pip
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ sudo pip uninstall pip
(Perhaps getting rid of the bogus version of pip would help?)
WARNING: The directory '/Users/xxx/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Found existing installation: pip 20.2.2
Uninstalling pip-20.2.2:
Would remove:
/usr/local/bin/pip
/usr/local/bin/pip3
/usr/local/bin/pip3.8
/usr/local/lib/python3.8/site-packages/pip-20.2.2.dist-info/*
/usr/local/lib/python3.8/site-packages/pip/*
Proceed (y/n)? y
Successfully uninstalled pip-20.2.2
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ pip3
Traceback (most recent call last):
File "/usr/local/opt/python#3.8/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ which pip3
/usr/local/opt/python#3.8/bin/pip3
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ pip
zsh: command not found: pip
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ which python3
/usr/local/opt/python#3.8/bin/python3
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ pip3 uninstall pip3
Traceback (most recent call last):
File "/usr/local/opt/python#3.8/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ find / -name pip 2>/dev/null
/usr/local/lib/python3.6/site-packages/pip
/usr/local/lib/python3.7/site-packages/pip
/usr/local/lib/python2.7/site-packages/pip
/usr/local/Cellar/python#2/2.7.15_3/bin/pip
/usr/local/Cellar/python#2/2.7.15_3/libexec/pip
/usr/local/Cellar/python#2/2.7.15_3/libexec/pip/build/lib/pip
/usr/local/Cellar/python#2/2.7.15_3/libexec/pip/src/pip
/usr/local/Cellar/python/3.7.6_1/libexec/pip
/usr/local/Cellar/python/3.7.6_1/libexec/pip/src/pip
/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/msi/pip
/usr/local/Cellar/python#3.8/3.8.2/libexec/bin/pip
/usr/local/Cellar/python#3.8/3.8.2/libexec/pip
/usr/local/Cellar/python#3.8/3.8.2/libexec/pip/build/lib/pip
/usr/local/Cellar/python#3.8/3.8.2/libexec/pip/src/pip
/usr/local/Cellar/python#3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/share/doc/python3.8/examples/Tools/msi/pip
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip
/Library/Python/2.7/site-packages/pip-19.2.2-py2.7.egg/pip
/System/Volumes/Data/usr/local/lib/python3.6/site-packages/pip
/System/Volumes/Data/usr/local/lib/python3.7/site-packages/pip
/System/Volumes/Data/usr/local/lib/python2.7/site-packages/pip
/System/Volumes/Data/usr/local/Cellar/python#2/2.7.15_3/bin/pip
/System/Volumes/Data/usr/local/Cellar/python#2/2.7.15_3/libexec/pip
/System/Volumes/Data/usr/local/Cellar/python#2/2.7.15_3/libexec/pip/build/lib/pip
/System/Volumes/Data/usr/local/Cellar/python#2/2.7.15_3/libexec/pip/src/pip
/System/Volumes/Data/usr/local/Cellar/python/3.7.6_1/libexec/pip
/System/Volumes/Data/usr/local/Cellar/python/3.7.6_1/libexec/pip/src/pip
/System/Volumes/Data/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/msi/pip
/System/Volumes/Data/usr/local/Cellar/python#3.8/3.8.2/libexec/bin/pip
/System/Volumes/Data/usr/local/Cellar/python#3.8/3.8.2/libexec/pip
/System/Volumes/Data/usr/local/Cellar/python#3.8/3.8.2/libexec/pip/build/lib/pip
/System/Volumes/Data/usr/local/Cellar/python#3.8/3.8.2/libexec/pip/src/pip
/System/Volumes/Data/usr/local/Cellar/python#3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/share/doc/python3.8/examples/Tools/msi/pip
/System/Volumes/Data/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
/System/Volumes/Data/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip
/System/Volumes/Data/Library/Python/2.7/site-packages/pip-19.2.2-py2.7.egg/pip
/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
/Users/robotbugs/Library/Caches/pip
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
~/Dropbox/Projects/FileSorting/ScreenShotSorter $ echo "What the f__k\!"
(What's with all these python versions - I thought I was using 3.8?)
What the f__k!
Related
I keep trying to update pip with:
pip install --upgrade pip
It seems to complete fine but when I run pip --version its still running the old version (19.0.3 vs 19.3). I'm using pycharm on Windows 10.
I'm trying to install pandas and I've read the issue I'm getting can be solved by updating pip and setuptools.
I saw some suggestions to delete the pip folder. So I went to Python38/Lib/site-packages and found 3 pip folders. pip, pip-19.0.3-py3.8egg. There was a 19.3 folder I deleted already.
If I delete the 19.0.3 folder I get an error running pip commands saying:
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 583, in _build_master
ws.require(__requires__)
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 19.3 (c:\users\jxdwa\appdata\roaming\python\python38\site-packages), Requirement.parse('pip==
19.0.3'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python38\Scripts\pip-script.py", line 6, in <module>
from pkg_resources import load_entry_point
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 3251, in <module>
def _initialize_master_working_set():
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 3263, in _initialize_master
_working_set
working_set = WorkingSet._build_master()
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 598, in _build_from_require
ments
dists = ws.resolve(reqs, Environment())
File "C:\Users\Jxdwa\AppData\Roaming\Python\Python38\site-packages\pkg_resources\__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.0.3' distribution was not found and is required by the application
when used below command I get these errors
sudo pip install sqlalchemy
Traceback (most recent call last):
File "/usr/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
3049, in <module>
#_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
660, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py",
line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.3' distribution was
not found and is required by the application
I then tried for pip version and got the below output
pip --version
pip 9.0.3 from /usr/lib/python3.4/dist-packages (python 3.4)
Creating environment variable PIP_TARGET can help or edit pip.conf file.
Another way is to use -t
sudo pip install sympy -t /path
I use docker commend docker-compose build and docker-compose up -d
yum install python-35 -y and install packages and I add pip-3.5 install --upgrade pip in docker-compose.yml it raise VersionConflict error
You are using pip version 9.0.2, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
+ pip-3.5 install awscli
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 666, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 984, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 875, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 9.0.2 (/usr/local/lib/python3.5/site-packages), Requirement.parse('pip==9.0.1'))
During handling of the above exception, another exception occurred:
but i don't know why it requires pip==9.0.1 to me...
how can i solved problem using pip>=9.0.2?
ADD
My setup.py
install_requires = [
'nitro>=1.3.0,<1.4.0',
'mysqlclient',
'requests',
'beautifulsoup4',
'google-api-python-client',
'httplib2',
'raven',
]
and when I check aws-cli/setup.py on github
and aws-cli/requirement.txt
there is no pip=9.0.1
and when i change pip-3.5 install awscli -> pip-3.5 install ipython
it have same error
+ pip-3.5 install ipython
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 666, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 984, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 875, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 9.0.3 (/usr/local/lib/python3.5/site-packages), Requirement.parse('pip==9.0.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pip-3.5", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3144, in <module>
#_call_aside
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3128, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3157, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 668, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 681, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 870, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application
Calling pip through python did the trick for me, e.g.:
python3 -m pip install --upgrade pip==9.0.1
(or whatever version you see in Requirement.parse('pip==X.Y.Z'))
I solved my problem
pip-3.5 install --upgrade pip
and
pip install awscli not pip-3.5 install awscli
it is work fine
On Mac M1, it can be solved by reinstalling python by running brew reinstall python.
When I tried to install Jupiter, I got the error :
┌─╼ [~]
└────╼ sudo -H pip install jupyter
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3036, in <module>
#_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 656, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 669, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application
and here what I have when I execute the command pip --version, I got
pip 9.0.1 from /home/jeremie/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (python 2.7)
What could I do to fix this problem?
Thanks in advance!
P.S. I am running Ubuntu 16.10.
sudo -H pip is the system pip
File "/usr/local/bin/pip",
pip --version is the pip on your local path
pip 9.0.1 from /home/jeremie/Enthought/Canopy_64bit/User/lib/python2.7/site-packages (python 2.7)
Don't use sudo
[root#ip-172-31-34-8 ec2-user]# sudo pip install -U boto
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 616, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 629, in _build_from_requirements
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 807, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==6.1.1
If you are installing on a fresh EC2 machine, which I guess from the first line of your code, you may not have pip installed.
For recent versions of AWS Linux AMI, you may use easy_install instead:
sudo easy_install pip
And then:
sudo easy_install boto3
Or:
sudo pip install boto3