Search code examples
pythonanacondasite-packages

Python continues to install a module despite a pip uninstall


I used pip to uninstall the google python module. However, import google still works. What am I missing?? I want to banish this module from my computer

enter image description here


Solution

  • The fact that the repr of google is <module 'google' (built-in)> implies that the module was baked into your interpreter; it can't be uninstalled, because it's been baked into Python itself (deleting it would involve carving out pieces of python.exe or python*.dll). Even C extension modules will reference their file if they were built separately (to a .dll/.pyd on Windows, to a .so on UNIX-likes); the fact that it doesn't provide the path to an existing file/folder means it's really built-in.

    You see the same behavior in normal (non-Anaconda) Python installs with "critical" modules like sys which are considered so critical to normal Python functionality (e.g. implementing loading of modules) and/or always used so early in every Python program that it's not worth splitting them out for lazy loading.

    It looks like the Anaconda folks baked google into the build for your distribution, they didn't just ship it "alongside". Point is, you can't uninstall it without replacing your Anaconda install with one that doesn't have it.