安装Mercurial 3.4.2 for mac

时间:2016-09-13 07:37:48

标签: python macos mercurial pip

我正在尝试使用代码安装Mercurial 3.4.2 for mac:

 pip install mercurial==3.4.2

但是有一个错误:

 Collecting mercurial==3.4.2
Installing collected packages: mercurial
Found existing installation: mercurial 3.9.1
  DEPRECATION: Uninstalling a distutils installed project (mercurial) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
 Uninstalling mercurial-3.9.1:
Exception:
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
 File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
  os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/mercurial-3.9.1-py2.7.egg-info'

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

This solution对我有帮助:

sudo chown -R $(whoami) $(brew --prefix)/*