• Mac安装最新tensorflow遇到的坑,记录下方便后人


    之前其他mac电脑安装tensorflow时候一切顺利,一行命令sudo pip install tensorflow就高搞定了,但是今天在新mac上安装tensorflow时候出现了一个bug,搞了半天终于搞完了。。。

    网上还没啥相关解决措施,蛋碎一地,也没有相关用户po这问题,应该是新的tensorflow对mac的支持问题,废话不多说:

    mac上pip安装tensorflow时候,会先安装所有依赖包

    在安装其中依赖包grpcio时候出现:(就是这个grpcio,原来的tensorflow里面是不依赖这个的,现在才有的)

    “”“DEPENDENCY ERROR

    The target you are trying to run requires an OpenSSL implementation.
    Your system doesn't have one, and either the third_party directory
    doesn't have it, or your compiler can't build BoringSSL.

    Please consult INSTALL to get more information.

    If you need information about why these tests failed, run:

    make run_dep_checks
    ”“”
    显示mac系统上没有openssl

    terminal敲openssl version
    显示LibreSSL

    网上查了下苹果已经放弃openssl,转向libressl了,但是在编译grpcio的时候仍需要openssl

    解决措施:
    1. 安装brew:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    2. 执行:brew install openssl

    3. 添加环境变量: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

    4. 再次执行openssl version 显示 OpenSSL, 执行 which openssl 显示 /usr/local/opt/openssl/bin/openssl

    5. 执行:export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include, 为了编译时让编译器找到库和头文件所在位置

    6. 重新执行sudo pip install grpcio,问题解决

    7. 执行sudo pip install tensorflow,ok!

  • 相关阅读:
    截屏 多难未遂
    捕捉异常
    Android中缓存记忆
    Android中的线程池
    悄悄为Android中解决部分适配问题哦!
    java中的服务端跳转与客户端跳转区别与联系
    doget(),doput()方法的使用
    基本概念--同步,异步
    java--SimpleDataFormat类
    java--9
  • 原文地址:https://www.cnblogs.com/zihaowang/p/8495636.html
Copyright © 2020-2023  润新知