You are not logged in.

#1 2017-06-21 16:40:44

pinkfloyd92
Member
Registered: 2016-05-02
Posts: 12

I can't use pip2 error finding 'package.requirements' package

Recently I deleted all the files from the directory

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

Now I am desperate, I can't use pip2, I already reinstalled some of the packages I deleted but now I don't know how to fix this one, I already installed the package python2-packaging and the file requirements.py is in that directory:

Traceback (most recent call last):
  File "/usr/bin/pip2", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 74, in <module>
    __import__('pkg_resources.extern.packaging.requirements')
  File "/usr/lib/python2.7/site-packages/pkg_resources/extern/__init__.py", line 61, in load_module
    "distribution.".format(**locals())
ImportError: The 'packaging.requirements' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.

Is there an easier way to fix this? I already tried to reinstall python2 and python2-pip.

Offline

#2 2017-06-21 16:50:24

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,723
Website

Re: I can't use pip2 error finding 'package.requirements' package

Why did you delete that directory? Did you reinstall all the packages that install files to it? Check with 'pacman -Qo /usr/lib/python2.7/site-packages' to get a list of the aforementioned packages, then 'pacman -Qkk pkg pkg ...'. Any packages that report missing files, reinstall.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2017-06-21 16:51:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,545
Website

Re: I can't use pip2 error finding 'package.requirements' package

First fix *all* of the packages you broke.  Get a list of what you need to reinstall with `pacman -Qkq`


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2017-06-21 17:47:36

pinkfloyd92
Member
Registered: 2016-05-02
Posts: 12

Re: I can't use pip2 error finding 'package.requirements' package

Thanks guys! finally pip2 is working!

Offline

#5 2017-06-21 18:07:47

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,723
Website

Re: I can't use pip2 error finding 'package.requirements' package

Great. Remember to mark your thread as solved by editing the first post and amending your topic title.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB