您的位置:首页 > 其它

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

2017-09-12 21:58 375 查看
执行

$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/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: