美文网首页
ubuntu安装pip3

ubuntu安装pip3

作者: Kimmygogo | 来源:发表于2019-10-27 22:49 被阅读0次

    安装pip3出现错误

    root@localhost:~# pip3 install pymysql
    Traceback (most recent call last):
    File "/usr/bin/pip3", line 9, in <module>
    from pip import main
    File "/usr/lib/python3/dist-packages/pip/init.py", line 14, in <module>
    from pip.utils import get_installed_distributions, get_prog
    File "/usr/lib/python3/dist-packages/pip/utils/init.py", line 23, in <module>
    from pip.locations import (
    File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module>
    from distutils import sysconfig
    ImportError: cannot import name 'sysconfig'

    • python版本与pip版本不匹配
    apt autoremove python3-pip
    apt autoremove python3
    apt install python3-pip
    root@localhost:~# pip3 install pymysql
    Collecting pymysql
      Downloading https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae95/PyMySQL-0.9.3-py2.py3-none-any.whl (47kB)
        100% |████████████████████████████████| 51kB 10kB/s 
    Installing collected packages: pymysql
    Successfully installed pymysql-0.9.3
    
    

    相关文章

      网友评论

          本文标题:ubuntu安装pip3

          本文链接:https://www.haomeiwen.com/subject/tcfvuctx.html