Recently I try to install some package or update the pip, similar error message pops out.
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/utils/__init__.py", line 315, in renames
shutil.move(old, new)
File `enter code here`"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/2.7/bin/pip'
I think that might due to an improper uninstallation of python on macport cause it, as when I try to change different python with the use of
port select --list python
and
sudo port select --set "python name"
and when I type
which python
all of them leads to
/opt/local/bin/python
none of them connected to the Frameworks. I wanna ask is there anyway to restore the mac preinstalled python?