Forums

Problem installing few packages

I have recently installed uuid packager for Python 3.6 with the BASH code pip3.6 install --user uuid.

Now, I have to install others packages but if I execute one of the fowllowing

  • pip3.6 install --user urllib.request
  • pip3.6 install --user codecs
  • pip3.6 install --user json
  • pip3.6 install --user BeautifulSoup
  • pip3.6 install --user time
  • pip3.6 install --user pathlib

I always get this error:

Traceback (most recent call last):   File "/usr/local/bin/pip3.6",
line 7, in <module>
    from pip import main   File "/usr/local/lib/python3.6/dist-packages/pip/__init__.py", line 21, in
<module>
    from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning   File
"/usr/local/lib/python3.6/dist-packages/pip/_vendor/requests/__init__.py",
line 62, in <module>
    from .packages.urllib3.exceptions import DependencyWarning   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/requests/packages/__init__.py",
line 27, in <module>
    from . import urllib3   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/requests/packages/urllib3/__init__.py",
line 8, in <module>
    from .connectionpool import (   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py",
line 41, in <module>
    from .request import RequestMethods   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/requests/packages/urllib3/request.py",
line 7, in <module>
    from .filepost import encode_multipart_formdata   File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/requests/packages/urllib3/filepost.py",
line 4, in <module>
    from uuid import uuid4   File "/home/Zekka/.local/lib/python3.6/site-packages/uuid.py", line 138
    if not 0 <= time_low < 1<<32L:
                                ^ SyntaxError: invalid syntax

How can I resolve this problem and install the list of others packages?

[edit by admin: formatting]

Interesting. It looks like the uuid package on PyPi hasn't been updated since 2007, so it's (a) not compatible with Python 3, and (b) doesn't specify in its configuration that it's not compatible. So pip installs it without any warnings, but is then completely broken afterwards, as you've noticed :-S

Anyway, the fix is simple -- even though you can't use pip to uninstall it, you can get rid of it manually just by removing the file. Run this in a bash console:

rm /home/Zekka/.local/lib/python3.6/site-packages/uuid.py

Thank you @Giles, now I can run others pip installations.

Excellent! Glad I could help.