美文网首页
ModuleNotFoundError: No module n

ModuleNotFoundError: No module n

作者: 足迹人生2017 | 来源:发表于2018-10-14 10:57 被阅读73次

    今天 在fedora上安装redis 突然提示

    Traceback (most recent call last):
      File "/usr/bin/dnf", line 57, in <module>
        from dnf.cli import main
      File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
        import dnf.base
      File "/usr/lib/python3.6/site-packages/dnf/base.py", line 26, in <module>
        from dnf.comps import CompsQuery
      File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 29, in <module>
        import dnf.util
      File "/usr/lib/python3.6/site-packages/dnf/util.py", line 32, in <module>
        import librepo
    ModuleNotFoundError: No module named 'librepo'
    
    

    百度后发现应该是之前使用conda安装tesserocr不小心把python3重装了,把之前的python3‵的librepo扩展弄没了
    于是先安装librepo模块
    https://rpmfind.net/linux/rpm2html/search.php?query=python3-librepo

    rpm -ivh librepo-1.8.1-7.fc28.x86_64.rpm
    rpm -ivh python3-librepo-1.8.1-7.fc28.x86_64.rpm
    

    安装完后还是报错
    参考一篇文章
    https://stackoverflow.com/questions/48291272/no-module-librepo-after-installing-pytorch-on-fedora27

    echo 'import sys;sys.path += ["/usr/lib64/python3.6/site-packages/", "/usr/lib64/python3.6/"]' | sudo tee /usr/lib/python3.6/site-packages/lib64.pth
    

    参考

    https://stackoverflow.com/questions/48944604/modulenotfounderror-no-module-named-librepo

    相关文章

      网友评论

          本文标题:ModuleNotFoundError: No module n

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