0

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)
  • Take a look at [this](https://stackoverflow.com/questions/24174821/how-to-change-default-install-location-for-pip/24175174) – user3738870 Sep 28 '18 at 18:23
  • `File /usr/lib/**python2.7**` vs `pip 9.0.3 from /usr/lib/**python3.4**`. See the difference? – phd Sep 28 '18 at 21:17

1 Answers1

0

Creating environment variable PIP_TARGET can help or edit pip.conf file. Another way is to use -t

sudo pip install sympy -t /path
Monish K Nair
  • 136
  • 1
  • 13