升级了Mac 系统后发现用pip安装pytest出现下面链接中的问题,解决方法是在install时候加上--user选项:

1. 切到home directory: cd ~

2. install pytest:  pip install pytest --user

Collecting pytest

Using cached pytest-3.2.2-py2.py3-none-any.whl

Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pytest)

Collecting py>=1.4.33 (from pytest)

Using cached py-1.4.34-py2.py3-none-any.whl

Installing collected packages: py, pytest

Successfully installed py-1.4.34 pytest-3.2.2

原文链接如下:

http://marcelog.github.io/articles/mac_osx_python_pip_install_operation_not_permitted.html

PIP Install on Mac: Operation Not Permitted

 

If you are trying to do a

pip install <package>

on a Mac and get an error like

Could not create /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7: Operation not permitted

You hit an internal protection called System Integrity Protection built-in OS X El Capitan and laterthat, among other things, protects some paths of your root filesystem in a way that not even the user root can write to them.

And your are not alone, this "issue" has hit a lot of users of different open source Python packages, as one can see in some GitHub Issues.

In the specific case of using PIP to install Python packages, you can overcome this by installing everything into your own home directory with the --user flag, like:

pip install <package> --user

This flag is documented in the "Installing to the User Site" section of the "Python Packaging User Guide", and there is more in depth description of the process in the "User Installs" section of the "PIP User Guide"

For more information on SIP, I recommend you start with this great article about OSX El Capitan System Integrity Protection (or SI

pip install pytest on Mac (EI Capitan 10.11.6)的更多相关文章

  1. OS X EI Capitan 10.11.4中sudo无法起作用的解决方法

    mac升级到OSX EI Capitan 10.11.4后sudo命令无法起作用,执行任何操作总是显示Operation denied.这是因为在10.11.4中引入了Rootless机制,即就算是R ...

  2. iOS开发之网络篇-CocoaPods的安装 EI Capitan 10.11 之前的方式

    注意:此种方式,在苹果系统 EI Capitan 10.11  之前的版本,新版本有所不同 一.安装 1> 查看gem源 $ gem sources –l 2> 删除源 (因为本人是第N次 ...

  3. OS X EI Capitan 10.11.1快速升级方法介绍

    公告:本文纯粹是给国内小水管用户而写的,如果你们家网络是100M光线那么就不需要看本文了! 一句话概要本文:在本地山寨从App store服务器上下载安装包的动作! 导读:OS X EI Capita ...

  4. Xcode8.0 / OS X EI Capitan 10.11.6 提交报错90111

    改用新系统和新版xcode(都是正式版)后,提交App Store审核时报错: INFO ITMS-90111: "Beta Toolchain. 构建新的 App 和App 更新时,必须使 ...

  5. X230 安装 EI Capitan 10.11.5 驱动篇

    /* 键盘又换回了 美蓓亚键盘 缩写nmb    虽然比群光软 但是手感真的出色,貌似x宝没有这个代工厂的键盘(全新,非拆机,而且是标准us阵列,背光版) 有人肯定会问,博主这么纠结键盘干嘛?     ...

  6. X230 安装 EI Capitan 10.11.5 总结

    /*     写这个文章的目的主要是为了帮助我自己理清思路,如果能顺便帮助到您.even better   */ 在动手之前大致浏览了 远景论坛(国内第一黑苹果社区)置顶帖的全部内容 [新人请看]远景 ...

  7. OS X EI Capitan 10.11 & xcode 7.0 beta(7A120f) -- cocoapods安装失败

    1.sudo gem install cocoapods: ERROR:While executing gem ... (Errno:EPERM) Operation not permitted - ...

  8. mac El Capitan 10.11.6

    http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=1702502&authorid=4532202&page=1

  9. Caffe on Mac OS X 10.11

    在Mac环境安装Caffe环境(CPU_ONLY) http://blog.csdn.net/xidiancoder/article/details/52081519   有问题 http://blo ...

随机推荐

  1. jsonModel使用

    流弊的JSON数据模型框架 https://github.com/jsonmodel/jsonmodel 版本 1.3.0 如果你喜欢JSONModel,并且使用了它,请你: star一下 给我一些反 ...

  2. Java内省机制

    转自: https://blog.csdn.net/hahalzb/article/details/5972421 1.java内省机制其实通俗的理解为,对自身的进行一个扫描,这个扫描的对象就是我们普 ...

  3. JavaScript 浏览器中的事件

    1.事件的基本概念 事件是指在文档或者浏览器中发生的一些特定交互瞬间,比如打开某一个网页,浏览器加载完成后会触发 load 事件,当鼠标悬浮于某一个元素上时会触发 hover 事件,当鼠标点击某一个元 ...

  4. python 一些方法的时间测试

    尝试一些方法的不同实现,比较一下时间,电脑比较渣,不过只是做个比较 虽然用python主要是方便,肯定是不快的,不过能快一点还是快一点好 numpy中大量使用同样 shape 的全 0 array,可 ...

  5. 学习笔记CB014:TensorFlow seq2seq模型步步进阶

    神经网络.<Make Your Own Neural Network>,用非常通俗易懂描述讲解人工神经网络原理用代码实现,试验效果非常好. 循环神经网络和LSTM.Christopher ...

  6. robotframework之上传功能

    上传功能,分为上传图片以及上传文件 1.上传文件 A)上传文件的html标签为input类型,可以直接输入文本中input文件路径,可以省略点击[上传文件]这一步骤 B)直接输入使用的关键词为:cho ...

  7. NPOI设置单元格背景色

    NPOI设置单元格背景色在网上有好多例子都是设置为NPOI内置的颜色值 但是想用rgb值来设置背景色,即:通过HSSFPalette类获取颜色值时会抛出异常:Could not Find free c ...

  8. etectMultiScale(gray, 1.2,3,CV_HAAR_SCALE_IMAGE,Size(30, 30))

    # 函数原型detectMultiScale(gray, 1.2,3,CV_HAAR_SCALE_IMAGE,Size(30, 30)) # gray需要识别的图片 # 1.03:表示每次图像尺寸减小 ...

  9. VMware vSphere Client 语言切换

      vpxclient -locale en_US 英语 vpxclient -locale zh_CN 汉语 vpxclient -locale ja 日语 vpxclient -locale de ...

  10. Mybatis逆向工程的配置

    源码github下载地址:https://github.com/wcyong/mybatisGeneratorCustom.git 参考文章:https://www.cnblogs.com/whgk/ ...