ImportError: cannot import name 'SecretsCollection' from 'detect_secrets'
See original GitHub issueDescribe the issue
When I install checkov using python3 -m pip install checkov
and then try to execute checkov
I get:
Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in <module>
from checkov.main import run
File "/usr/local/lib/python3.9/site-packages/checkov/main.py", line 33, in <module>
from checkov.common.util.docs_generator import print_checks
File "/usr/local/lib/python3.9/site-packages/checkov/common/util/docs_generator.py", line 16, in <module>
from checkov.secrets.runner import CHECK_ID_TO_SECRET_TYPE
File "/usr/local/lib/python3.9/site-packages/checkov/secrets/runner.py", line 7, in <module>
from detect_secrets import SecretsCollection
ImportError: cannot import name 'SecretsCollection' from 'detect_secrets' (/usr/local/lib/python3.9/site-packages/detect_secrets/__init__.py)
However, if I install with Brew I do not face this issue.
Desktop (please complete the following information):
- OS: Mac 12.1
- Checkov Version: 2.0.817
Additional context
I have tried a few different versions, but always reproduce. I even face the same issue using Debian GNU/Linux 11 (bullseye)
. Am I doing something wrong?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
ImportError: cannot import name SensitivityValues · Issue #4
When installing latest version of detect-secrets-server using: git clone ... ImportError: cannot import name SensitivityValues #4.
Read more >python - "ImportError: cannot import name 'key' from 'secrets'"
secrets is a module added python stdlib in v3.6. Your code is trying to import key from there, which doesn't exists.
Read more >azure-keyvault-secrets - PyPI
Asynchronously list secrets. Set a secret. set_secret creates new secrets and changes the values of existing secrets. If no secret with the given...
Read more >Using Secret Manager with Python - Google Codelabs
Secret Manager allows you to store, manage, and access secrets as binary blobs or text strings. With the appropriate permissions, you can view ......
Read more >Resolve Secrets Manager secret access errors after ... - AWS
Re-encrypt the secret with the new AWS KMS key. · 1. Open the Secrets Manager console. · 2. In Secret name, choose your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
currently you can only move to either run
checkov
via our Docker image or usepipx
to install it in a dedicated virtual env.yeah, pre-commit hook also works, because it creates a dedicated virtual env and installs all the dependencies there, also the latest version of
detect-secrets
. Same goes for brew installation it creates a virtual env with all needed dependencies, which are not shared with your global python env.