2

I've Installed Pip3 but I'm unable to use pip3.2 which seems to be interfering with some packages that I install via pip3.

$ pip3 install pymysql
$ pip3 list | grep PyMySQL
PyMySQL (0.7.11)

$ python3
Python 3.2.3 (default, Mar 25 2017, 08:49:29)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pymysql

Noticing that python3 defaults to python 3.2.3 I looked into pip3.2:

$ pip3.2 list | grep PyMySQL

Traceback (most recent call last):
  File "/usr/local/bin/pip3.2", line 7, in <module>
    from pip import main
  File "/usr/local/lib/python3.2/dist-packages/pip/__init__.py", line 21, in <module>
    from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
  File "/usr/local/lib/python3.2/dist-packages/pip/_vendor/requests/__init__.py", line 66, in <module>
    from .models import Request, Response, PreparedRequest
  File "/usr/local/lib/python3.2/dist-packages/pip/_vendor/requests/models.py", line 856
    http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
                                                      ^
SyntaxError: invalid syntax

I don't know how pip3 was installed originally but I'd like to uninstall and then reinstall using How to install pip with Python 3?.

Update

I have run $ pip uninstall pip but pip3 still remains installed on the system.

I then ran $ sudo apt-get remove python-pip & $ sudo apt-get remove python3-pip but it's still installed.


What's the best way to remove pip3?

Community
  • 1
  • 1
pele88
  • 802
  • 2
  • 8
  • 16

1 Answers1

0

To avoid this conflict,

First Uninstall your current pip package using this command,

pip uninstall pip

Then try to install pip with python3 again using,

sudo apt-get install python3-pip

It should work.

Ahmed Ginani
  • 6,522
  • 2
  • 15
  • 33
  • I've tried that and it hasn't worked: `$ pip3.2` still returns the same error message. `$ pip3` now returns `pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application` – pele88 Apr 21 '17 at 11:36