美文网首页Python
Mac下pip 安装 常见问题

Mac下pip 安装 常见问题

作者: 踏云小子 | 来源:发表于2017-01-09 16:35 被阅读626次

1.pip安装出现权限错误

Paste_Image.png
error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share': Operation not permitted

出现这个是因为macOS Sierra搞了奶啊的SIP机制(System Integrity Protection),真是闲的蛋疼,所以

a) 方案一:直接把sip给关闭了,简单点,把你关了
重启电脑,按住Command+R(直到出现苹果标志)进入Recovery Mode(恢复模式)
左上角菜单里找到实用工具 -> 终端
输入csrutil disable回车
重启Mac即可

b) 方案二:不那么粗暴,温柔点,把你留着

pip install (package name) --user -U

2.出现如下错误

Paste_Image.png
方法:

用H标志

sudo -H pip install xxx

3.安装PIL出现如下错误

Collecting pil Could not find a version that satisfies the requirement pil (from versions: ) Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pil to allow).No matching distribution found for pil
方法:

后来查了解决办法:见 http://stackoverflow.com/questions/19532125/cant-install-pil-after-mac-os-x-10-9
使用如下步骤pip install Pillow

4.安装LXML出现如下错误

Paste_Image.png
方法:
sudo C_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2/libxml:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MaOSX10.12.sdk/usr/include pip install lxml  

相关文章

  • Mac下pip 安装 常见问题

    1.pip安装出现权限错误 出现这个是因为macOS Sierra搞了奶啊的SIP机制(System Integr...

  • tensorflow入门-数字识别

    1安装tensflow mac下安装tensflow的方法 1安装了pip 2sudo pip ins...

  • flask环境搭建

    需要事先安装python 2.7和pip Mac环境下sudo pip install flask win下pip...

  • Mac下安装pip(install pip on Mac)

    出现以下内容即为安装成功

  • 【接口/性能】python01-requests&uni

    mac下实践 1. 安装requests库(python的第三方库) mac下安装pip: brew instal...

  • Mac下安装pip

    pip是常用的python包管理工具,类似于java的maven,node的npm。 在home-brew中,pi...

  • mac 下安装pip

    pip是常用的Python包管理工具,类似于Java的maven。用python的同学,都离不开pip。 在新ma...

  • Mac 下安装pip

    pip是python的包管理工具,准备写爬虫所以安装下。 Step1.brew install pip(不能下载)...

  • Mac 下安装Pip

    1、打开终端执行:sudo easy_install pip 然后这样了: 解决:输入:curlhttps://b...

  • mac下安装pip

    mac下使用sudo easy_install pip会报错。 所以直接下载pip压缩包并解压。下载压缩包:pip...

网友评论

    本文标题:Mac下pip 安装 常见问题

    本文链接:https://www.haomeiwen.com/subject/xadhbttx.html