升级了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. React Native 获取组件(Component)在屏幕上的位置

    年后主客户端的需求以及老的业务迁移RN,现在疯狂的在学RN.在迁移需求的时候遇到需要获取组件在屏幕上的绝对位置.页面如下: 就需要展开的时候获取sectionHeader(默认排序)在屏幕上的具体位置 ...

  2. vba批量作图心得1

    1.1:连续有几个图的时候,如果需要设置某一个图的横坐标标签隐藏,要注意将坐标轴标签属性和坐标轴曲线粗细的属性区分开来 1.2:PlotArea里面有left和insideLeft属性,结合两个可以控 ...

  3. mysql数据库简单一些简单操作和总结

    1. mysql 数据库操作方法: 进入数据库 mysql -uroot -p 退出 quite exit 默认引擎 innodb 查看版本 select verison(); 查看时间 select ...

  4. pycharm 的配置

    装好了pycharm之后 一.新建项目:(两个接口) 或 出现下图便创建成功: 二.配置本地项目编译器:(每个项目都要配一次) 出现下图就配置成功了: 三.pycharm + linux 远程开发(此 ...

  5. zznuoj 1540 : 直线与圆

    题目描述 给出一个圆的圆心坐标与圆的半径,和一条直线上的两点坐标,求这条直线与圆有多少个交点. 输入 输入3个实数x,y,r值分别表示圆心坐标与圆的半径,输入4个实数x1,y1,x2,y2表示直线上的 ...

  6. 前端开发模拟数据------webpack-api-mocker

    应用场景: 在实际的项目开发过程中,一般都会进行前后端分离的开发模式,前端通过mock或者其他的插件模拟后台返回数据的功能.在常用的webpack构建工程项目中,通过和webpack-dev-serv ...

  7. H5中input[type="date"]默认样式修改 伪类

  8. 使用 ReSharper,输入即遵循 StyleCop 的代码格式化规范

    使用 ReSharper,输入即遵循 StyleCop 的代码格式化规范 StyleCop 可以帮助强制执行代码格式化规范,ReSharper 可以帮助你更高效地编写代码.把两者结合起来,你便能高效地 ...

  9. 在Ubuntu下安装lrzsz

    目录 自动安装 手动安装 下载 解压 安装 创建连接 在Ubuntu 14.04x64下安装lrzsz 自动安装 在终端中,输入命令 sudo apt-get install lrzsz 由于一些原因 ...

  10. 让Entity Framework不再私闯sys.databases

    这里的“私闯sys.databases”是指Entity Framework默认发起的查询:SELECT Count(*) FROM sys.databases WHERE [name]=N'数据库名 ...