Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip uninstall on El Capitan #11

Closed
hawesie opened this issue Oct 2, 2015 · 2 comments
Closed

pip uninstall on El Capitan #11

hawesie opened this issue Oct 2, 2015 · 2 comments

Comments

@hawesie
Copy link
Contributor

hawesie commented Oct 2, 2015

The command
pip freeze | xargs sudo pip uninstall -y
no longer works on El Capitan as the new security layer prevents some files being deleted which pip owns (or thinks it owns). It fails on the first system dependency, which is altgraph on my machine:

(output, for future googlers)

Uninstalling altgraph-0.10.2:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 305, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 315, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
@hawesie
Copy link
Contributor Author

hawesie commented Oct 2, 2015

The following removes those installs which can be done by the user

#!/bin/bash
for i in $( pip freeze ); do
    sudo pip uninstall -y $i
done

@spmaniato
Copy link
Contributor

I found this issue after asking on SO. In case it helps anyone in the future, here's my (related but not the same) question / issue: http://stackoverflow.com/questions/35049907/cannot-sudo-pip-uninstall-operation-not-permitted-tmp-in-os-x-el-capitan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants