0

I had installed Scrapy with pip install scrapy. It also install all its requirement packages Installing collected packages: zope.interface, Twisted, six, cssselect, w3lib, parsel, pycparser, cffi, pyasn1, idna, cryptography, pyOpenSSL, attrs, pyasn1-modules, service-identity, queuelib, PyDispatcher, scrapy. So, is it possible to uninstall scrapy and all its requirement packages with a terminal command?

erickh
  • 11
  • 1
  • 5

3 Answers3

0

It is a bit contrived but you can use something like this

for p in `pip show scrapy | grep 'Requires:' | tr ',' ' ' | cut -d " " -f2-`;
do
    pip uninstall $p;
done;
mic4ael
  • 7,974
  • 3
  • 29
  • 42
  • I try it, but some of the packages do not uninstall. Look like it can only detect some of the packages only. – erickh Jul 06 '16 at 07:52
0

pip-autoremove is a Python package that removes packages and all its dependencies:

pip install pip-autoremove
pip-autoremove <package> -y
oz19
  • 1,616
  • 1
  • 17
  • 22
-1

pip uninstall currently doesn't support removing the dependencies. You can manually go to the folder where scrapy is installed and delete it. For example: /usr/local/lib/python2.7/dist-packages/scrapy.

For example if it is at '/PATH/TO/SCRAPY', run this command on the terminal:

sudo rm -rf /PATH/TO/SCRAPY

harshit-sh
  • 358
  • 1
  • 3
  • 17
  • I think you misunderstand the question. What I want is a command that can uninstall scrapy and all its requirement package like zope.interface, Twisted and others. – erickh Jul 06 '16 at 07:26