Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'pkg_resources' #215

Open
exploide opened this issue Jun 16, 2024 · 1 comment
Open

No module named 'pkg_resources' #215

exploide opened this issue Jun 16, 2024 · 1 comment

Comments

@exploide
Copy link

exploide commented Jun 16, 2024

Certipy does not only depend on setuptools during build time, it is also a runtime dependency because in

import pkg_resources
the pkg_resources module is imported, which comes from the setuptools package.

If you install Certipy in a fresh environment (e.g. a new virtualenv, or via pipx, at least with Python 3.12) the module is not available and the following error occurs:

$ certipy
Traceback (most recent call last):
  File "/home/user/repos/Certipy/venv/bin/certipy", line 5, in <module>
    from certipy.entry import main
  File "/home/user/repos/Certipy/venv/lib/python3.12/site-packages/certipy/entry.py", line 6, in <module>
    from certipy import version
  File "/home/user/repos/Certipy/venv/lib/python3.12/site-packages/certipy/version.py", line 1, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

As a quick fix, setuptools should be added to the install_requires section of setup.py. However, according to the setuptools docs pkg_resources is deprecated anyway and should be substituted.

@AV3T
Copy link

AV3T commented Jul 12, 2024

For those that encounter the same issue, I found that injecting setuptools within the certipy-ad pipx environment helps with the error "ModuleNotFoundError: No module named 'pkg_resources":

pipx inject certipy-ad setuptools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants