pip install pytest on Mac (EI Capitan 10.11.6)

时间:2022-06-30 18:39:37

升级了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&period;11&period;4中sudo无法起作用的解决方法

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

  2. iOS开发之网络篇-CocoaPods的安装 EI Capitan 10&period;11 之前的方式

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

  3. OS X EI Capitan 10&period;11&period;1快速升级方法介绍

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

  4. Xcode8&period;0 &sol; OS X EI Capitan 10&period;11&period;6 提交报错90111

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

  5. X230 安装 EI Capitan 10&period;11&period;5 驱动篇

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

  6. X230 安装 EI Capitan 10&period;11&period;5 总结

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

  7. OS X EI Capitan 10&period;11 &amp&semi; xcode 7&period;0 beta&lpar;7A120f&rpar; -- cocoapods安装失败

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

  8. mac El Capitan 10&period;11&period;6

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

  9. Caffe on Mac OS X 10&period;11

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

随机推荐

  1. OO Design

    什么是设计原则? 设计原则是基本的工具,应用这些规则可以使你的代码更加灵活.更容易维护.更容易扩展.基本原则:封装变化Encapsulate what varies.面向接口变成而不是实现 Code ...

  2. 利用SVN工具下载OpenCore代码

    OpenCore原来使用的是CVS管理代码的.从09年起,更换用SVN管理代码,大家可以用TortoiseSVN软件下载代码,网址是:http://tortoisesvn.net/,安装后tortoi ...

  3. 手把手教你Linux服务器集群部署&period;net网站 - Linux系统安装和设置

    在开源软件已成趋势化的今天,微软这‘老古董’也开始向开源方向发力,这对我们.NET开发者是极大的喜讯.而在开源软件中, Linux就是其中一个优秀的代表,几乎各行业和计算机有关的都有它的身影,其中一点 ...

  4. 去除C&sol;C&plus;&plus;程序代码中的注释

    最近搞软件著作权,去除代码空行和注释比较麻烦,想写个程序自动去除,去网上搜了下,发现有类似的程序,不过只有去除注释.鉴于word中可以去除空行(用^p^p替换^p),先用网上的代码,以后有时间写个完整 ...

  5. hao123 百度品专 按品类 计算 下单数量 商品数量 下单金额?

    SELECT * FROM t_tag_source WHERE   s_name='hao123'; +--------+----------+---------+--------+-------- ...

  6. javascript第四章--面向对象的程序设计

    ① 理解对象 ② 创建对象 ③ 继承

  7. android扫描网页二维码进行网页登录

    转载请标明出处: http://www.cnblogs.com/dingxiansen/: 本文出自:丁先森-博客园 周六和朋友去网吧开黑,开机打开TGP,朋友那边开始输入账号密码,我看了他一眼low ...

  8. 简单的C程序

    1.最简单的C程序 #include<stdio.h> //预编译处理指令 int main() // 定义主函数 { printf("hello world"); } ...

  9. php实现单点登录实例

    1.准备两个虚拟域名 127.0.0.1 www.a.com127.0.0.1 www.b.com 2.在a的根目录下创建以下文件 1 //index.php 2 3 <?php 4 sessi ...

  10. Python中的编码问题(encoding与decode、str与bytes)

    1 引言 在文件读写及字符操作时,我们经常会出现下面这几种错误: TypeError: write() argument must be str, not bytes AttributeError: ...