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

dep_check.py fails because pip.get_installed_distributions does not work #268

Open
GIJack opened this issue Sep 8, 2018 · 2 comments
Open

Comments

@GIJack
Copy link

GIJack commented Sep 8, 2018

Please provide the following details.

Host System

Error Description

Traceback (most recent call last):
File "datasploit.py", line 4, in
dep_check.check_dependency()
File "/home/jack/Documents/github-tools/datasploit/dep_check.py", line 11, in check_dependency
pip_list = sorted([(i.key) for i in pip.get_installed_distributions()])
AttributeError: 'module' object has no attribute 'get_installed_distributions
Please provide the details of the error. Try to provide the output and also steps to reproduce (if possible).

If you cloned Datasploit, also provide the output of git log -n 1 --pretty=format:"%B".

The error is this line in dep_check.py:

pip_list = sorted([(i.key) for i in pip.get_installed_distributions()])

As per: pypa/pip#5243

Python recommends using pkg_resources.working_set from python-setuptools instead.

EDIT: Pull Request here: #269

@GIJack GIJack changed the title dep_check.py dep_check.py fails because pip.get_installed_distributions does not work Sep 8, 2018
@KhasMek
Copy link

KhasMek commented Sep 28, 2018

This issue is a duplicate of #255 which already has a fix submitted in PR #262. Please check currently submitted issues before creating new ones.

@manishj1996
Copy link

Alternatively, you can add the following line: import pkg_resources
And replace pip_list = sorted([(i.key) for i in pip.get_installed_distributions()])
with pip_list = sorted([(i.key) for i in pkg_resources.working_set])

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

3 participants