推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
numberator
V2EX  ›  Python

怎么都 ModuleNotFoundError 了?

  •  
  •   numberator · Aug 9, 2023 via Android · 2215 views
    This topic created in 1153 days ago, the information mentioned may be changed or developed.
    我的 Arch Linux 所有的 packages 都返回 ModuleNotFoundError: No module named 'xxx'

    是怎么回事?

    Traceback (most recent call last):

    File "/home/kimbley/.local/bin/tw_gcal_sync", line 5, in <module>

    from syncall.scripts.tw_gcal_sync import main

    ModuleNotFoundError: No module named 'syncall'





    Traceback (most recent call last):

    File "/usr/bin/fava", line 5, in <module>

    from fava.cli import main

    ModuleNotFoundError: No module named 'fava'
    3 replies  •  2023-08-09 14:30:34 +08:00
    NessajCN
        1
    NessajCN  
       Aug 9, 2023
    是不是滚了一下让大版本更新了(譬如 3.10->3.11)
    这样没用 venv 的话本来装在~/.local/lib/python3.10/site-packages/ 下的包就读不到了
    numberator
        2
    numberator  
    OP
       Aug 9, 2023 via Android
    @NessajCN 那怎么办它现在好像还不让用 pip 直接装包了,要先创建虚拟环境。能退回版本吗?
    NessajCN
        3
    NessajCN  
       Aug 9, 2023
    @numberator 新版 python 推荐两个方法装 module:
    1 、创建虚拟环境 (venv)
    2 、用 pipx
    选一个用就好
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   741 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:36 · PVG 04:36 · LAX 13:36 · JFK 16:36
    ♥ Do have faith in what you're doing.