{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/setuptools/issues/1433","repository_url":"https://api.github.com/repos/pypa/setuptools","labels_url":"https://api.github.com/repos/pypa/setuptools/issues/1433/labels{/name}","comments_url":"https://api.github.com/repos/pypa/setuptools/issues/1433/comments","events_url":"https://api.github.com/repos/pypa/setuptools/issues/1433/events","html_url":"https://github.com/pypa/setuptools/issues/1433","id":343362707,"node_id":"MDU6SXNzdWUzNDMzNjI3MDc=","number":1433,"title":"Setup of 40.0 via pip on MacOS High Sierra is not successful","user":{"login":"adam-ah","id":3745745,"node_id":"MDQ6VXNlcjM3NDU3NDU=","avatar_url":"https://avatars3.githubusercontent.com/u/3745745?v=4","gravatar_id":"","url":"https://api.github.com/users/adam-ah","html_url":"https://github.com/adam-ah","followers_url":"https://api.github.com/users/adam-ah/followers","following_url":"https://api.github.com/users/adam-ah/following{/other_user}","gists_url":"https://api.github.com/users/adam-ah/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-ah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-ah/subscriptions","organizations_url":"https://api.github.com/users/adam-ah/orgs","repos_url":"https://api.github.com/users/adam-ah/repos","events_url":"https://api.github.com/users/adam-ah/events{/privacy}","received_events_url":"https://api.github.com/users/adam-ah/received_events","type":"User","site_admin":false},"labels":[{"id":1097197838,"node_id":"MDU6TGFiZWwxMDk3MTk3ODM4","url":"https://api.github.com/repos/pypa/setuptools/labels/Needs%20Repro","name":"Needs Repro","color":"179fc1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-21T23:18:05Z","updated_at":"2018-10-22T16:19:41Z","closed_at":null,"author_association":"NONE","body":"I'm trying to install using pip but Mac OS X, 10.13.4 is already shipped with an old version\r\n```\r\npip --version\r\npip 10.0.1 from /Library/Python/2.7/site-packages/pip (python 2.7)\r\n```\r\n\r\n```\r\nMacBook-Pro:KerasDemo user$ sudo pip install setuptools --upgrade\r\nPassword:\r\nThe directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\r\nThe directory '/Users/user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\r\nCollecting setuptools\r\n  Downloading https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl (567kB)\r\n    100% |████████████████████████████████| 573kB 3.0MB/s \r\nInstalling collected packages: setuptools\r\n  Found existing installation: setuptools 18.5\r\n    Uninstalling setuptools-18.5:\r\nCould not install packages due to an EnvironmentError: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', \"[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'\"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', \"[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'\"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', \"[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'\"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', \"[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'\"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', \"[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-2PS_oP/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'\")]\r\n```\r\n\r\nOK, let's try a user install:\r\n\r\n```\r\nMacBook-Pro:KerasDemo user$ sudo pip install setuptools --upgrade --user\r\nThe directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\r\nThe directory '/Users/user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\r\nCollecting setuptools\r\n  Downloading https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl (567kB)\r\n    100% |████████████████████████████████| 573kB 3.4MB/s \r\nInstalling collected packages: setuptools\r\nSuccessfully installed setuptools-40.0.0\r\n```\r\n\r\nBut then:\r\n\r\n```\r\nMacBook-Pro:KerasDemo user$ which easy_install\r\n/Users/user/Library/Python/2.7/bin/easy_install\r\nMacBook-Pro:KerasDemo user$ easy_install\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/easy_install-2.7\", line 11, in <module>\r\n    load_entry_point('setuptools==18.5', 'console_scripts', 'easy_install')()\r\n  File \"/Users/user/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py\", line 479, in load_entry_point\r\n    return get_distribution(dist).load_entry_point(group, name)\r\n  File \"/Users/user/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py\", line 2703, in load_entry_point\r\n    return ep.load()\r\n  File \"/Users/user/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py\", line 2321, in load\r\n    return self.resolve()\r\n  File \"/Users/user/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py\", line 2327, in resolve\r\n    module = __import__(self.module_name, fromlist=['__name__'], level=0)\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py\", line 46, in <module>\r\n    from setuptools.archive_util import unpack_archive\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/archive_util.py\", line 15, in <module>\r\n    from pkg_resources import ensure_directory, ContextualZipFile\r\nImportError: cannot import name ContextualZipFile\r\n```\r\n\r\nOr maybe just try to ignore and install it anyway:\r\n\r\n```\r\nMacBook-Pro:KerasDemo user$ sudo pip install setuptools --ignore-installed\r\nThe directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\r\nThe directory '/Users/user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\r\nCollecting setuptools\r\n  Downloading https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl (567kB)\r\n    100% |████████████████████████████████| 573kB 3.1MB/s \r\nInstalling collected packages: setuptools\r\nCould not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/usr/local/bin/easy_install'\r\n```\r\n\r\nThe bottom line is that I can't seem to install setuptools 40.0 so it has a valid and working binary in /usr/local/bin/easy_install\r\n\r\nAny help would be appreciated."},"comment":{"url":"https://api.github.com/repos/pypa/setuptools/issues/comments/431884623","html_url":"https://github.com/pypa/setuptools/issues/1433#issuecomment-431884623","issue_url":"https://api.github.com/repos/pypa/setuptools/issues/1433","id":431884623,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTg4NDYyMw==","user":{"login":"jaraco","id":308610,"node_id":"MDQ6VXNlcjMwODYxMA==","avatar_url":"https://avatars2.githubusercontent.com/u/308610?v=4","gravatar_id":"","url":"https://api.github.com/users/jaraco","html_url":"https://github.com/jaraco","followers_url":"https://api.github.com/users/jaraco/followers","following_url":"https://api.github.com/users/jaraco/following{/other_user}","gists_url":"https://api.github.com/users/jaraco/gists{/gist_id}","starred_url":"https://api.github.com/users/jaraco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaraco/subscriptions","organizations_url":"https://api.github.com/users/jaraco/orgs","repos_url":"https://api.github.com/users/jaraco/repos","events_url":"https://api.github.com/users/jaraco/events{/privacy}","received_events_url":"https://api.github.com/users/jaraco/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T16:19:41Z","updated_at":"2018-10-22T16:19:41Z","author_association":"MEMBER","body":"I do run on a mac. I've had High Sierra and now have Mojave... but I avoid and strongly recommend you avoid using the Python provided by the system. It's almost always old often has its own peculiarities. I don't even have pip installed in the system Python:\r\n\r\n```\r\n$ /usr/bin/python2.7 -m pip -V\r\n/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named pip\r\n```\r\n\r\nI do see that I have setuptools installed, though I suspect that was installed by macOS and not by me:\r\n\r\n```\r\n$ /usr/bin/python2.7 -m easy_install --version\r\nsetuptools 18.5 from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (Python 2.7)\r\n```\r\n\r\nI also strongly second pganssle's recommendation to use homebrew or pyenv. I personally use Homebrew, even for when I need Python 2.7. With Homebrew's `python@2` installed, and with `/usr/local/bin` ahead on the path, my default Python 2.7 is the one from homebrew:\r\n\r\n```\r\n~ $ python2.7 -V\r\nPython 2.7.15\r\n~ $ python2.7 -c \"import sys; print(sys.executable)\"\r\n/usr/local/opt/python@2/bin/python2.7\r\n```\r\n\r\nAnd with homebrew properly configured not to require sudo, setuptools installs and upgrades nicely without sudo:\r\n\r\n```\r\n~ $ python2.7 -m pip install -U setuptools\r\nCollecting setuptools\r\n  Using cached https://files.pythonhosted.org/packages/96/06/c8ee69628191285ddddffb277bd5abdf769166e7a14b867c2a172f0175b1/setuptools-40.4.3-py2.py3-none-any.whl\r\nInstalling collected packages: setuptools\r\n  Found existing installation: setuptools 39.2.0\r\n    Uninstalling setuptools-39.2.0:\r\n      Successfully uninstalled setuptools-39.2.0\r\nSuccessfully installed setuptools-40.4.3\r\nYou are using pip version 18.0, however version 18.1 is available.\r\nYou should consider upgrading via the 'pip install --upgrade pip' command.\r\n```\r\n\r\nAlso, I want to recommend that even if you have to use `sudo` for some operations, you should avoid using `sudo` with `--user` (for any application), as that creates files in `~/.local` (or similar) that are owned by `root` and often not accessible by the user.\r\n\r\nI hope that helps. Let us know what you find."}}
{"actor":{"display_login":"jaraco"}}