Update permission not allowed: how to update pip on Mac OS X?

I am new to Mac OS X. I want to set up a python programming environment. I use pip to manage third-party packages.

I installed pip using easy_install.

sudo easy_install pip 

I tried running upgrade pip from 6.1.0 to 6.1.1 . However, my request was rejected and I received the following message.

 $ pip install --upgrade pip You are using pip version 6.1.0, however version 6.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Collecting pip Using cached pip-6.1.1-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 6.1.0 Uninstalling pip-6.1.0: Successfully uninstalled pip-6.1.0 Rolling back uninstall of pip Exception: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/basecommand.py", line 246, in main status = self.run(options, args) File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/commands/install.py", line 352, in run root=options.root_path, File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/req/req_set.py", line 711, in install **kwargs File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/req/req_install.py", line 806, in install self.move_wheel_files(self.source_dir, root=root) File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/req/req_install.py", line 1007, in move_wheel_files isolated=self.isolated, File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/wheel.py", line 347, in move_wheel_files generated.extend(maker.make(spec)) File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/_vendor/distlib/scripts.py", line 323, in make self._make_script(entry, filenames, options=options) File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/_vendor/distlib/scripts.py", line 227, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/_vendor/distlib/scripts.py", line 201, in _write_script self._fileop.write_binary_file(outname, script_bytes) File "/usr/local/lib/python2.7/site-packages/pip-6.1.0-py2.7.egg/pip/_vendor/distlib/util.py", line 388, in write_binary_file with open(path, 'wb') as f: IOError: [Errno 13] Permission denied: '/usr/local/bin/pip' 

I don't seem to have permission to update pip. I think this is not a problem of lack of dependent packages. The OS X system I'm using is OS X 10.10.3. And I am using Python 2.7.9.

Can someone help me solve this problem?

+6
source share
1 answer

You installed it using sudo easy_install pip , which creates a pip created by the root user.

When updating it, you should also use:

 sudo pip install --upgrade pip 
+12
source

Source: https://habr.com/ru/post/986346/


All Articles