question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'

See original GitHub issue
  • Pip version:1.5.4
  • Python version:2.7.6
  • Operating System:ubuntu 14.04

Description:

How can i solve the following problem:

I was trying to install autograd and scikit-learn, both through pip command. However, both installation failed, with the error OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip'

thus i guess these error may caused by pip, so i test pip with update command 'pip install -U pip ', it replied IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'

I guess pip on my machine is broken? Any advice is pretty appreciate, thanks.

What I’ve run:

The log of running command ‘pip install -U pip’ listed below:

Downloading/unpacking pip from https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
  Can't roll back pip; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 312, in move_wheel_files
    generated.extend(maker.make(spec))
  File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/scripts.py", line 311, in make
    self._make_script(entry, filenames, options=options)
  File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/scripts.py", line 215, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/scripts.py", line 195, in _write_script
    self._fileop.write_binary_file(outname, script_bytes)
  File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/util.py", line 384, in write_binary_file
    with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'

Storing debug log for failure in /home/eric/.pip/pip.log

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

202reactions
xavfernandezcommented, Dec 18, 2016

You should add the --user option to install without needing root permission.

25reactions
shaopengyuancommented, Apr 29, 2017

add --user works! I have tried.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install failing with: OSError: [Errno 13] Permission denied ...
Rather than using sudo with pip install , It's better to first try pip install --user . If this fails then take a...
Read more >
Error [Errno 13] on install telegram-bot on python : Forums
Error [Errno 13] on install telegram-bot on python ... in _get with open(path, 'rb') as stream: IOError: [Errno 13] Permission denied: ...
Read more >
Permission denied: '/usr/local/bin/pip' Consider using the
... to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/bin/pip' Consider using the `--user` option or check the permissions.
Read more >
Python PermissionError: [errno 13] permission denied Solution
To fix this error, use the chmod or chown command to change the permissions of the file so that the right user and/or...
Read more >
错误IOError: [Errno 13] Permission denied: u'/home/daidai ...
错误:IOError: [Errno 13] Permission denied: u'/home/daidai/Public/chuangke/app/migrations/0001_initial.py'原因:迁移数据时的权限不够被拒绝 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found