Search code examples
apscheduler

How to use APScheduler without installing it?


I know the normal way to use APScheduler is "python setup.py install". But I want to embed it into my program directly, so the user don't need install it when using my program.

class BaseScheduler(six.with_metaclass(ABCMeta)):

_trigger_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.triggers'))
# print(_trigger_plugins, 'ddd')
_trigger_classes = {}
_executor_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.executors'))
_executor_classes = {}
_jobstore_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.jobstores'))
_jobstore_classes = {}
_stopped = True

thks.


Solution

  • I find a way to work around this problem.

    1. use 'pip install apscheduler' to install locally
    2. goto the installed directory and cp that directory to your lib directory
    3. use 'pip uninstall apscheduler' to remove it.
    4. make you code to import the apscheduler from your lib directory.
    5. done.