Yelp / detect-secrets-server

Apache License 2.0
108 stars 34 forks source link

ImportError: cannot import name 'CronSlices' from 'crontab' #66

Open hopewise opened 4 years ago

hopewise commented 4 years ago

I've just installed detect-secrets-server on Ubuntu 20.04 but, when I try to add a local repo, I get this error:

detect-secrets-server add /home/samir/projects/website --local
Traceback (most recent call last):
  File "/usr/local/bin/detect-secrets-server", line 5, in <module>
    from detect_secrets_server.__main__ import main
  File "/home/samir/.local/lib/python3.8/site-packages/detect_secrets_server/__main__.py", line 6, in <module>
    from detect_secrets_server.core.usage.parser import ServerParserBuilder
  File "/home/samir/.local/lib/python3.8/site-packages/detect_secrets_server/core/usage/parser.py", line 6, in <module>
    from .add import AddOptions
  File "/home/samir/.local/lib/python3.8/site-packages/detect_secrets_server/core/usage/add.py", line 4, in <module>
    from crontab import CronSlices
ImportError: cannot import name 'CronSlices' from 'crontab' (/usr/local/lib/python3.8/dist-packages/crontab/__init__.py)

any idea?

nick-hunter commented 3 years ago

Just ran into this same issue. Not sure if you've figured it out, but for anyone else who sees this, you probably have crontab installed instead of python-crontab

securestep9 commented 3 years ago

Getting the same error, looks like the requirements.txt are not included in the PyPi package?

nick-hunter commented 3 years ago

If you run pip install detect-secrets-server then python-crontab will not be installed. If you run pip install detect-secrets-server[cron] then everything should be fine. While the latter command is in the install instructions, I think python-crontab should just be included by default to reduce confusion.