0

While trying to local install a python rpm (in directory ~/.local/)

with python setup.py install --user

I get the error:

File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 701, in process_distribution
distreq.project_name, distreq.specs, requirement.extras
TypeError: __init__() takes exactly 2 arguments (4 given)

After checking fileeasy_install in line 701, I found out that Requirement class produced the error which is imported from pkg_resources

I found out that inside folder: /usr/lib/python2.7/site-packages/ there exist:

  1. /usr/lib/python2.7/site-packages/pkg_resources.py
  2. /usr/lib/python2.7/site-packages/pkg_resources/

Inside pkg_resources.py class Requirement takes 4 arguments

while class Requirement from

/usr/lib/python2.7/site-packages/pkg_resources/_vendor/packaging  /requirements.py

takes 2 arguments

How may I uninstall folder:

/usr/lib/python2.7/site-packages/pkg_resources/

May I just delete its contents?

dimitris lepipas
  • 263
  • 3
  • 15

1 Answers1

0

I think you should upgrade your setuptools:

pip install -U pip setuptools

Also I believe you should backup and remove pkg_resources.py, I don't know where the module comes from.

phd
  • 82,685
  • 13
  • 120
  • 165