For some reason, pip3 does not install packages to the proper dist-packages directory, at least not the directory I expect.
I am trying to install the package cleverwrap currently, but this happens for all packages installed with pip3 as far as I can tell.
I am running this command:
sudo pip3 install cleverwrap
This command installs to /usr/local/lib/python2.7/dist-packages/
Shouldn't it install to /usr/local/lib/python3.4/dist-packages/
?
crawforc3@raspberrypi:~$ python --version
Python 2.7.9
crawforc3@raspberrypi:~$ python3 --version
Python 3.4.2
crawforc3@raspberrypi:~$ which pip
/usr/local/bin/pip
crawforc3@raspberrypi:~$ which pip3
/usr/local/bin/pip3
crawforc3@raspberrypi:~$ python3 -m pip install cleverwrap
/usr/bin/python3: No module named pip
crawforc3@raspberrypi:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Output from pip3 show cleverwrap
crawforc3@raspberrypi:~$ pip3 show cleverwrap
Name: cleverwrap
Version: 0.2.3.2
Summary: A wrapper for the official cleverbot.com API
Home-page: https://github.com/edwardslabs/cleverwrap.py
Author: Andrew Edwards
Author-email: andrewthomasedwards@gmail.com
License: MIT
Location: /usr/local/lib/python2.7/dist-packages
Requires: requests
@Hydraxan14 suggested this answer:
I changed where pip looks for python3. This resulted in a version conflict. Something was looking for a different version of pip than was installed.
Output from pip3 -V
crawforc3@raspberrypi:/usr/local/bin$ pip3 -V
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 449, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 745, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 644, in resolve
raise VersionConflict(dist, req)
pkg_resources.VersionConflict: (pip 1.5.6 (/usr/lib/python3/dist-packages), Requirement.parse('pip==9.0.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2876, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 451, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 464, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==9.0.1
Updating pip3 with this command solved the version conflict and everything works now.
sudo python3 -m pip install pip --upgrade