macos pip install 一直报错的解决方法

本文介绍了解决使用pip安装软件时遇到的各种错误的方法,包括通过添加–user-U参数来解决权限和连接超时等问题。

执行

$pip install xxx(软件名)

之后报一堆错,比如:

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-5CyiYk/python-gflags/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_Mg7Um-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-5CyiYk/python-gflags/

或者:

raise ProtocolError('Connection broken: %r' % e, e)
ProtocolError: ("Connection broken: error(60, 'Operation timed out')", error(60, 'Operation timed out'))

解决方法:在pip命令后面加上–user -U:

sudo pip install tensorflow --user -U

参考:
http://xiaorui.cc/2016/03/27/%E8%A7%A3%E5%86%B3mac-osx%E4%B8%8Bpip%E5%AE%89%E8%A3%85ipython%E6%9D%83%E9%99%90%E7%9A%84%E9%97%AE%E9%A2%98/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值