我是靠谱客的博主 执着菠萝,最近开发中收集的这篇文章主要介绍MacOS安装virtualenvwrapper出错的解决办法,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

在MacOS安装virtualenvwrapper,提示如下错误:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-71obON-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

解决办法

原来的安装命令:

sudo pip install virtualenvwrapper -v

添加“–ignore-install six”参数,如下:

sudo pip install virtualenvwrapper -v --ignore-install six

或者采用依次安装的方式,如下:

# 首先安装six
sudo pip install six==1.11.0 --ignore-install six
# 然后安装virtualenvwrapper
sudo pip install virtualenvwrapper -v

最后,检查six的版本,发现已更新到最新版本,如下:

pip show six
#   或者
pip search six

得到如下的输出:

six (1.11.0)  - Python 2 and 3 compatibility utilities
  INSTALLED: 1.11.0 (latest)

参考资料

  1. Unable to uninstall six-1.4.1 #245
  2. Pip User Guide
  3. 如何在 Mac 上启用 root 用户或更改 root 密码
  4. virtualenvwrapper Command Reference

最后

以上就是执着菠萝为你收集整理的MacOS安装virtualenvwrapper出错的解决办法的全部内容,希望文章能够帮你解决MacOS安装virtualenvwrapper出错的解决办法所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部