Skip to content

Instantly share code, notes, and snippets.

@fonylew
Last active March 6, 2020 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonylew/1dc6fe19b8b043b0b6ed3c956e66aa04 to your computer and use it in GitHub Desktop.
Save fonylew/1dc6fe19b8b043b0b6ed3c956e66aa04 to your computer and use it in GitHub Desktop.
Common Python Problem

Common Python Problems and Solutions

pip3 is broken

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

Solution: sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall Ref: pypa/pip#5447 (comment)

Reinstall Pip

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get-pip.py --force-reinstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment