ubuntu bionic 出现 ImportError: cannot import name ‘sysconfig’

Posted on Posted in python

ubuntu bionic 出现 ImportError: cannot import name 'sysconfig'

问题

Traceback (most recent call last):
  File "get-pip.py", line 20651, 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/tmpbq4tzj3l/pip.zip/pip/_internal/__init__.py", line 42, in <module>
  File "/tmp/tmpbq4tzj3l/pip.zip/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/tmp/tmpbq4tzj3l/pip.zip/pip/_internal/index.py", line 24, in <module>
  File "/tmp/tmpbq4tzj3l/pip.zip/pip/_internal/download.py", line 34, in <module>
  File "/tmp/tmpbq4tzj3l/pip.zip/pip/_internal/locations.py", line 10, in <module>
ImportError: cannot import name 'sysconfig'

解决方法

sudo apt-get install python3-distutils

Leave a Reply

Your email address will not be published. Required fields are marked *

7 + sixteen =