I\'m trying to upgrade setuptools. Well actually I\'m trying to upgrade ansible but it\'s trying to upgrade setuptools and failing. Trying to do it myself also fails. Even t
The answer is that you cannot update setuptools on OSX for the factory python that ships with the OS. The reason is that the files in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python cannot be removed or modified by the user. Not only the normal user but even if you have root permissions you will be unable to modify those files.
Sure you can use various other methods to install a newer version of setuptools but this will not override the default system package. Meaning if you go the suggested route of use the --user python flag, or you choose to install them without root into ~/Library, these will not override the system files version.
The reason you or root are unable to modify the system defaults is due to SIP permission restrictions in El Capitan+. You could disable SIP but this is generally not recommended.
Instead the only reasonable solution is to use a python virtualenv.