推荐学习书目
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
Murphy0123
V2EX  ›  Python

关于 apscheduler 库无法被识别的问题

  •  
  •   Murphy0123 · Mar 11, 2020 · 3540 views
    This topic created in 2269 days ago, the information mentioned may be changed or developed.
    运行下面程序的时候

    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-

    from apscheduler.schedulers.blocking import BlockingScheduler


    def p():
    print("a")

    if __name__ == '__main__':
    scheduler = BlockingScheduler()
    scheduler.add_job(p, "cron",second='1/5')

    try:
    scheduler.start()
    except Exception as e:
    pass

    运行结果显示 No module named 'apscheduler.schedulers'; 'apscheduler' is not a package,但是我已经通过 pip 安装了 apscheduler 库,还会有什么其他的问题出现呢
    7 replies    2020-03-13 08:43:47 +08:00
    wzwwzw
        1
    wzwwzw  
       Mar 11, 2020
    检查一下运行环境?
    Murphy0123
        2
    Murphy0123  
    OP
       Mar 11, 2020
    @wzwwzw 这个应该怎么检测?刚开始学,还不太会,请大神指点一下。。。
    frostming
        3
    frostming  
       Mar 11, 2020
    hwenwur
        4
    hwenwur  
       Mar 11, 2020
    用下面这个命令重新安装试试:
    env python3 -m pip install apscheduler --user
    Murphy0123
        5
    Murphy0123  
    OP
       Mar 12, 2020
    @frostming 好的,谢谢大神


    @hwenwur 重新安装好像还是不太行
    tohearts
        6
    tohearts  
       Mar 12, 2020
    我怀疑你的项目包名是不是叫 apscheduler
    TestOpsJarstick
        7
    TestOpsJarstick  
       Mar 13, 2020 via iPhone
    @tohearts 我也是这样认为的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   926 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 20:38 · PVG 04:38 · LAX 13:38 · JFK 16:38
    ♥ Do have faith in what you're doing.