解决办法:

$ sudo chown -R $USER /usr/local/lib/python2.
$ pip install mock --ignore-installed six --user

问题:安装mock时报错:

(venv)➜  test git:(master) pip install mock
Requirement already satisfied: mock in /Library/Python/2.7/site-packages
Collecting six>=1.9 (from mock)
Using cached six-1.11.-py2.py3-none-any.whl
Requirement already satisfied: funcsigs>=; python_version < "3.3" in /Library/Python/2.7/site-packages (from mock)
Requirement already satisfied: pbr>=0.11 in /Library/Python/2.7/site-packages (from mock)
Installing collected packages: six
Found existing installation: six 1.4.
DEPRECATION: Uninstalling a distutils installed project (six) 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 six-1.4.:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line , in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line , in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line , in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line , in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line , in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line , in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line , in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line , in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line , in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno ] Operation not permitted: '/var/folders/pk/7yrbjrzx0j76mvd9s49djz_40000gn/T/pip-ogx4a9-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

参考:https://github.com/donnemartin/haxor-news/issues/54

pip install --ignore-installed six

又报错:

(venv)➜  test git:(master) pip install mock --ignore-installed six
Collecting mock
Using cached mock-2.0.-py2.py3-none-any.whl
Collecting six
Using cached six-1.11.-py2.py3-none-any.whl
Collecting funcsigs>=; python_version < "3.3" (from mock)
Using cached funcsigs-1.0.-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock)
Using cached pbr-3.1.-py2.py3-none-any.whl
Installing collected packages: six, funcsigs, pbr, mock
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line , in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line , in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line , in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line , in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line , in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line , in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line , in clobber
shutil.copyfile(srcfile, destfile)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line , in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno ] Permission denied: '/Library/Python/2.7/site-packages/six.py'

参考:https://github.com/pypa/pip/issues/4186

pip install mock --ignore-installed six --user

又遇到错误:

Collecting mock
Using cached mock-2.0.-py2.py3-none-any.whl
Collecting six
Using cached six-1.11.-py2.py3-none-any.whl
Collecting funcsigs>=; python_version < "3.3" (from mock)
Using cached funcsigs-1.0.-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock)
Using cached pbr-3.1.-py2.py3-none-any.whl
Installing collected packages: six, funcsigs, pbr, mock
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line , in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line , in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line , in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line , in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line , in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line , in move_wheel_files
maker.make_multiple(['%s = %s' % kv for kv in console.items()])
File "/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py", line , in make_multiple
filenames.extend(self.make(specification, options))
File "/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py", line , in make
self._make_script(entry, filenames, options=options)
File "/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py", line , in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py", line , in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/Library/Python/2.7/site-packages/pip/_vendor/distlib/util.py", line , in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno ] Permission denied: '/usr/local/bin/pbr'

最后:

(venv)➜  test git:(master) pip install mock --ignore-installed six --user
Collecting mock
Using cached mock-2.0.-py2.py3-none-any.whl
Collecting six
Using cached six-1.11.-py2.py3-none-any.whl
Collecting funcsigs>=; python_version < "3.3" (from mock)
Using cached funcsigs-1.0.-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock)
Using cached pbr-3.1.-py2.py3-none-any.whl
Installing collected packages: six, funcsigs, pbr, mock
Successfully installed funcsigs-1.0. mock-2.0. pbr-3.1. six-1.11.

错误:OSError: [Errno 1] Operation not permitted: 'lib/python/six-1.4.1-py2.7.egg-info'的更多相关文章

  1. macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:

    Exception: Traceback (most recent call last): File , in main status = self.run(options, args) File , ...

  2. 【Python学习笔记】macosx 10.11 python pip install 出现错误OSError: [Errno 1] Operation not permitted:

    http://www.cnblogs.com/xiongqiangcs/p/4914049.html pip install --upgrade pip sudo pip install numpy ...

  3. 安装 tensorflow 时遇到 OSError: [Errno 1] Operation not permitted 的解决办法

    Installing collected packages: numpy, scipy, six, pyyaml, Keras, opencv-python, h5py, html5lib, blea ...

  4. 安装Pod时提示ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod

    环境:OSX EI 10.11.1 昨天切换gem源后,招待pod安装没有任何问题,也可以正常用$ gem sources --add https://ruby.taobao.org/ --remov ...

  5. ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod

    因为突然要用到cocospod,突然发现在使用pod install的时候出现 -bash: pod: command not found 我去-不知道为什么,然后我就想重新安装下cocospod,在 ...

  6. 在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: ‘文件路径’

    如题,在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: '文件路径',在查阅了大量资料后也得到了一些解决方案,但是这些解决方案 ...

  7. 终端中出现While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod错误的修改方法

    把输入终端的sudo gem install cocoapods改为 sudo gem install -n /usr/local/bin/ cocoapods即可

  8. Jekyll 安装权限问题 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/jekyll

    OS X El Capitan 新特性(System Integrity Protection or SIP)中加强了权限,但是可以对这里进行操作 /usr/local/bin 可以尝试使用以下指令进 ...

  9. Mac OS X系统下,svn: Can't remove file Operation not permitted.解决方案

    当你的svn出现类似以下错误时,提示Operation not permitted之类的问题,说明项目下 .svn文件夹内的文件权限有问题. 一般是由于windows和mac操作系统同时操作同个svn ...

随机推荐

  1. 处理全站请求编码,无论是GET还是POST,默认是UTF-8

    1.java类: import java.io.IOException;import javax.servlet.Filter;import javax.servlet.FilterChain;imp ...

  2. 【11.5校内测试】【倒计时5天】【DP】【二分+贪心check】【推式子化简+线段树】

    Solution 非常巧妙的建立DP方程. 据dalao们说题目明显暗示根号复杂度??(反正我是没看出来 因为每次分的块大小一定不超过$\sqrt n$,要不然直接每个位置开一个块答案都才为$n$. ...

  3. Qt 4.8.2.+VS2008静态编译

    一.下载Qt 4.8.2-opensource. 二.解压到C:\Qt\4.8.2_static 修改C:\Qt\4.8.2_static\projects.pro文件,删除demos,doc,exa ...

  4. 分布式理论——从ACID到CAP再到BASE

    在传统的数据中,有ACID四大原则,在分布式中也有对应的CAP理论和BASE理论,这些都是分布式理论的基础. 更多内容参考:大数据学习之路 ACID ACID分别是Atomicity 原子性.Cons ...

  5. Android中AES256加密的实现

    AES加密是我们在工作中常用到一种加密方式,并且在java中也已经实现好了其相应的接口. 但是Java自带的JDK默认最多实现128位及其以下的加密.如果使用java自带的api实现aes256将会报 ...

  6. fatal error C1859 意外的预编译头错误,只需重新运行编译器(转)

    微软的建议 要解决此问题,请使用下列方法之一. http://support.microsoft.com/kb/976656/zh-cn 方法 1 禁用/analyze编译器选项,则它会被启用. 方法 ...

  7. Java ThreadLocal的使用

    Java中的ThreadLocal类允许我们创建只能被同一个线程读写的变量.因此,如果一段代码含有一个ThreadLocal变量的引用,即使两个线程同时执行这段代码,它们也无法访问到对方的Thread ...

  8. 奇怪吸引子---QiChen

    奇怪吸引子是混沌学的重要组成理论,用于演化过程的终极状态,具有如下特征:终极性.稳定性.吸引性.吸引子是一个数学概念,描写运动的收敛类型.它是指这样的一个集合,当时间趋于无穷大时,在任何一个有界集上出 ...

  9. oracle-用户和表空间创建

    windows下 创建临时表空间 create temporary tablespace user_temp tempfile 'D:\oracle\oradata\Oracle11i\user_te ...

  10. NatApp开启HTTPS访问方式

    一.首先需要到付费隧道中选择免费开启https 二.其次需要重新启动natapp服务,如下图出现两个隧道说明OK