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?
Asked
Active
Viewed 5,975 times
0

erickh
- 11
- 1
- 5
-
bwv549 here: http://stackoverflow.com/questions/7915998/does-uninstalling-a-package-with-pip-also-removes-the-dependent-packages suggested to install `pip-autoremove`. Check if it works or not. – harshit-sh Jul 06 '16 at 07:14
-
I think it solves my problem. Thank – erickh Jul 06 '16 at 07:31
-
So, `pip-autoremove` worked? – harshit-sh Jul 06 '16 at 07:32
-
I try and it works, but I don't know why @Bibhas comment said that the package broke. I used this command for python3. – erickh Jul 06 '16 at 07:35
-
Cool! Nice that it worked. – harshit-sh Jul 06 '16 at 07:37
3 Answers
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