josiahcarlson / parse-crontab

Parse and use crontab schedules in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use crontab

amelio-vazquez-reina opened this issue · comments

I have tried installing crontab as:

> pip install crontab

and as:

> pip install git+git://github.com/josiahcarlson/parse-crontab

on both Python 2.7.x and Python 3.4.x without luck.

However, whenever I invoke:

from crontab import CronTab
system_cron   = CronTab()
my_user_cron  = CronTab(user=True)
users_cron    = CronTab(user='dataxu')

I get:

> system_cron   = CronTab()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-4132e81e1caa> in <module>()
----> 1 system_cron   = CronTab()

TypeError: __init__() missing 1 required positional argument: 'crontab'

Why?

You have either installed the wrong crontab package, or you are looking at the wrong docs/demos.

The docs/demos that you included above with system_cron = CronTab() is from a different crontab package: https://pypi.python.org/pypi/python-crontab .

The crontab package you installed is: https://pypi.python.org/pypi/crontab .