0

There are a ton of questions, but the correct way seem to manually uninstall everything that you don't need. pip doesn't uninstall the dependencies of a package on uninstall and the pip-autoremove is reported to be broken. Here is my pip freeze:

altgraph==0.10.2
backports-abc==0.5
bdist-mpkg==0.5.0
bonjour-py==0.3
certifi==2016.9.26
dask==0.12.0
macholib==1.5.1
matplotlib==1.3.1
modulegraph==0.10.4
nose==1.3.7
numpy==1.8.0rc1
Pillow==3.4.2
py2app==0.7.3
pyobjc-core==2.5.1
pyobjc-framework-Accounts==2.5.1
pyobjc-framework-AddressBook==2.5.1
pyobjc-framework-AppleScriptKit==2.5.1
pyobjc-framework-AppleScriptObjC==2.5.1
pyobjc-framework-Automator==2.5.1
pyobjc-framework-CFNetwork==2.5.1
pyobjc-framework-Cocoa==2.5.1
pyobjc-framework-Collaboration==2.5.1
pyobjc-framework-CoreData==2.5.1
pyobjc-framework-CoreLocation==2.5.1
pyobjc-framework-CoreText==2.5.1
pyobjc-framework-DictionaryServices==2.5.1
pyobjc-framework-EventKit==2.5.1
pyobjc-framework-ExceptionHandling==2.5.1
pyobjc-framework-FSEvents==2.5.1
pyobjc-framework-InputMethodKit==2.5.1
pyobjc-framework-InstallerPlugins==2.5.1
pyobjc-framework-InstantMessage==2.5.1
pyobjc-framework-LatentSemanticMapping==2.5.1
pyobjc-framework-LaunchServices==2.5.1
pyobjc-framework-Message==2.5.1
pyobjc-framework-OpenDirectory==2.5.1
pyobjc-framework-PreferencePanes==2.5.1
pyobjc-framework-PubSub==2.5.1
pyobjc-framework-QTKit==2.5.1
pyobjc-framework-Quartz==2.5.1
pyobjc-framework-ScreenSaver==2.5.1
pyobjc-framework-ScriptingBridge==2.5.1
pyobjc-framework-SearchKit==2.5.1
pyobjc-framework-ServiceManagement==2.5.1
pyobjc-framework-Social==2.5.1
pyobjc-framework-SyncServices==2.5.1
pyobjc-framework-SystemConfiguration==2.5.1
pyobjc-framework-WebKit==2.5.1
pyOpenSSL==0.13.1
pyparsing==2.0.1
python-dateutil==1.5
pytz==2013.7
scipy==0.18.1
singledispatch==3.4.0.3
six==1.4.1
toolz==0.8.1
tornado==4.4.2
xattr==0.6.4
zope.interface==4.1.1

How to know which pakcages are installed by me? Is there a date entry maybe? Because I got heated with Python only the last week. I do not want to uninstall anything that will force me to reinsall Mac OS.

Community
  • 1
  • 1
gsamaras
  • 71,951
  • 46
  • 188
  • 305
  • I don't think you can know what packages YOU installed, but you can know what are the dependencies for each package: `pip show PACKAGE | grep 'Requires'` – pawamoy Dec 07 '16 at 12:38
  • SerialDev no. @Pawamoy that pretty much is the same thing, since I can see which packages are imported from my code. Should I delete the question, or you can post an answer? – gsamaras Dec 07 '16 at 12:39
  • 1
    Because of permissions (and system integrity protection), you will not even be able to uninstall packages that were provided by the system, so it's probably ok to just to try them all. However, you can also do it by looking at where they are installed, which you can do with `pip show`. If it's in your user directory, it's something you installed (but details will depend on which python you are using). – Andrew Jaffe Dec 07 '16 at 12:50
  • What @AndrewJaffe said makes sense, even sudo fails some times with some of my attempts. – gsamaras Dec 07 '16 at 12:51

1 Answers1

1

So if you need to find what are the dependencies of a package, just run pip show PACKAGE | grep 'Requires'. Still, you have to know which package YOU installed, and you have to be careful because dependencies could be shared with other "system" packages.

pawamoy
  • 3,382
  • 1
  • 26
  • 44
  • Hmm, for example I got: `pip show matplotlib | grep 'Requires' Requires: numpy, python-dateutil, tornado, pyparsing, nose`. Should I do `pip uninstall matplotlib` and the same for every dependency? What you said about system sharing scared me !! – gsamaras Dec 07 '16 at 12:47
  • What I mean is that some packages are installed by default, and packages like `six` are widely used by others (for compatibility between python versions), so you wouldn't want to uninstall `six` from your system. Maybe you could list every dep of every package, and uninstall only the ones that are deps of only packages YOU installed. – pawamoy Dec 07 '16 at 12:50
  • Damn really, [scikit-image](http://stackoverflow.com/questions/41005044/how-to-install-scikit-image) is trying to uninstall six, is that why it fails? – gsamaras Dec 07 '16 at 12:53
  • Maybe scikit-image needs another version of six, but I think its installation fails because you're trying to install it system-wide (which need admin rights). As answered in the post, virtualenv can be the solution since installing a package in a virtual env does not need admin rights. – pawamoy Dec 07 '16 at 12:55