0

I have Ubuntu 20.04 installed. I have python3.8 and python3-pip installed. however when executing pip install SomePackage I get this error.

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==7.1.0', 'console_scripts', 'pip')()
  File "/usr/local/lib/python3.8/dist-packages/pip-7.1.0-py3.8.egg/pip/__init__.py", line 217, in main
    return command.main(cmd_args)
  File "/usr/local/lib/python3.8/dist-packages/pip-7.1.0-py3.8.egg/pip/basecommand.py", line 216, in main
    with self._build_session(
  File "/usr/local/lib/python3.8/dist-packages/pip-7.1.0-py3.8.egg/pip/basecommand.py", line 68, in _build_session
    session = PipSession(
  File "/usr/local/lib/python3.8/dist-packages/pip-7.1.0-py3.8.egg/pip/download.py", line 316, in __init__
    self.headers["User-Agent"] = user_agent()
  File "/usr/local/lib/python3.8/dist-packages/pip-7.1.0-py3.8.egg/pip/download.py", line 92, in user_agent
    zip(["name", "version", "id"], platform.linux_distribution()),
AttributeError: module 'platform' has no attribute 'linux_distribution'
baldr
  • 2,514
  • 10
  • 37
  • 53
Erne MA
  • 3
  • 1

1 Answers1

0

You are using python 3.x.x. That's why you should use pip3.

Try like this:

pip3 install SomePackage

use this if pip3 doesn't load:

sudo apt install python3-pip

You can also update using this:

python3 -m pip install --upgrade pip
bdoz35
  • 16
  • 1