推荐学习书目
› 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 · 3968 views
    This topic created in 2434 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
    wzwwzw
    Mar 11, 2020
    1
    检查一下运行环境?
    Murphy0123
    Murphy0123
    OP
    Mar 11, 2020
    2
    @wzwwzw 这个应该怎么检测?刚开始学,还不太会,请大神指点一下。。。
    frostming
    frostming
    Mar 11, 2020
    3
    hwenwur
    hwenwur
    Mar 11, 2020
    4
    用下面这个命令重新安装试试:
    env python3 -m pip install apscheduler --user
    Murphy0123
    Murphy0123
    OP
    Mar 12, 2020
    5
    @frostming 好的,谢谢大神


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