pip: ImportError: cannot import name 'sysconfig'

  • Pip version:
  • Python version: Python 3.6.5
  • Operating system: Ubuntu 18.04 LTS

Description:

This is my first time to install pip in my Ubuntu 18.04 LTS that I have just installed for serveral days. After using “curl” command to download the “get-pip.py” file and running the command “python3 get-pip.py”, I got the error message. The error message is following.

What I’ve run:

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

python3 get-pip.py

The error message:

Traceback (most recent call last):
  File "get-pip.py", line 20649, in <module>
    main()
  File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal
  File "/tmp/tmpaa4p6j0e/pip.zip/pip/_internal/__init__.py", line 42, in <module>
  File "/tmp/tmpaa4p6j0e/pip.zip/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/tmp/tmpaa4p6j0e/pip.zip/pip/_internal/index.py", line 25, in <module>
  File "/tmp/tmpaa4p6j0e/pip.zip/pip/_internal/download.py", line 35, in <module>
  File "/tmp/tmpaa4p6j0e/pip.zip/pip/_internal/locations.py", line 10, in <module>
ImportError: cannot import name 'sysconfig'

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 20
  • Comments: 18 (4 by maintainers)

Most upvoted comments

It seems that python3-distutils is not installed.

sudo apt install python3-distutils

fix this issue.

Yay Ubuntu 😦

Are you OK to close this issue in that case?

@Tarliton It works! Thank u very much!

Python3.6 and Python3.6-dev are installed. I can successfully import sysconfig. Does that imply the full stdlib is present? I would have thought so.

For what it’s worth, I apt installed python3-distutils and it’s working for me now. I just thought it was strange, considering I thought I had the full python installation.