zoukankan      html  css  js  c++  java
  • 解决Mac安装M2Crypto提示无法找到openssl头文件问题

    大概是这种问题

    running build running build_py running build_ext building'M2Crypto.__m2crypto' extension swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c swig -python -I/usr/include/python2.7-I/usr/include -includeall -modern -builtin -outdir build/lib.linux-i686-2.7/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i SWIG/_evp.i:12:Error:Unable to find'openssl/opensslconf.h'SWIG/_ec.i:7:Error:Unable to find'openssl/opensslconf.h'error: command 'swig' failed with exit status 1

    由于OSX升级之后连 /usr/include 都没有了,使用命令

    ​xcode-select --install​

    安装xcode命令行工具,多装几次/usr/include就会回来

    然而里面还是没有 openssl  

    然后另外安装openssl 的时候会发现并没有把头文件ln到 /usr/include 里面,无卵用,/usr/include 还是一个不可更改的系统目录

    但是我们留意到安装​M2Crypto的时候报错的地方是提示 swig 语句有问题,于是可以修改swig 的寻址路径,如下,妥了:

    sudo env LDFLAGS="-L$(brew --prefix openssl)/lib"

    CFLAGS="-I$(brew --prefix openssl)/include"

    SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include"

    pip install m2crypto

    亲测成功

  • 相关阅读:
    leetcode 2 Add Two Numbers
    leetcode1
    二叉树的最大高度和最大宽度
    插入排序
    eventEmitter学习
    用node.js做一个爬虫
    HTLM5 WebSocket权威指南
    (new Function("return " + json))();
    JS中的this变量的使用介绍
    node.js 模块加载原理
  • 原文地址:https://www.cnblogs.com/0xcafedaddy/p/8260493.html
Copyright © 2011-2022 走看看