【问题标题】:easy_install M2Crypto failing on Windows platformeasy_install M2Crypto 在 Windows 平台上失败
【发布时间】:2011-09-20 04:12:20
【问题描述】:

我正在尝试在 Windows XP 平台上安装 M2Crypto。我安装了 Python、easy_install 和 SWIG,但是当我尝试 easy_install M2Crypto 时,我得到以下信息:

SWIG\_m2crypto.i(31) : Error: Unable to find 'openssl\opensslv.h'
SWIG\_m2crypto.i(45) : Error: Unable to find 'openssl\safestack.h'
SWIG\_evp.i(12) : Error: Unable to find 'openssl\opensslconf.h'
SWIG\_ec.i(7) : Error: Unable to find 'openssl\opensslconf.h'
error: Setup script exited with error: command 'swig.exe' failed with exit status 1

我在其他地方读到有人建议easy_install openssl-devel,但这只是告诉我没有找到具有该名称的软件包。名称是否可能区分大小写(我尝试了各种排列但均未成功),还是该建议不适用于 Windows?

我不是在寻找 M2Crypto 的替代品。我正在挑选一些使用它的现有代码,因此我需要让我的开发环境能够运行已经编写的内容。

【问题讨论】:

标签: windows openssl easy-install m2crypto


【解决方案1】:

正如 jay 在他的回答中所说,您应该尝试从源代码构建它。我试过了。 setup.py 无法识别 --openssl 选项。查看默认setup.py 的输出,我意识到搜索位置是c:\pkg 而不是c:\pkg\openssl。 解决办法:

  1. 从Win32 OpenSSL 下载并安装 OpenSSL
  2. 将lib 和include 文件夹复制到c:\pkg
  3. 检查swig.exe 在您的路径中是否可用
  4. 运行easy_install M2Crypto

像魅力一样为我工作。

【讨论】:

    【解决方案2】:

    遇到了类似的问题。下载 M2Crypto 的源码包并阅读 INSTALL 文件后发现如下:

    Differences when installing on Windows
    --------------------------------------
    
    Before building from source, you need to install OpenSSL's include files,
    import libraries and DLLs. By default setup.py assumes that OpenSSL include
    files are in ``c:\pkg\openssl\include``, and the import libraries 
    in ``c:\pkg\openssl\lib``. As with other platforms, you can specify a different
    OpenSSL location with --openssl option to build_ext command.
    

    【讨论】:

    • 感谢您的回复。我还没有机会检查这一点,因为我最终在非 Windows 机器上设置了一个开发环境。不过有时间我会试试看的。
    猜你喜欢
    • 2011-11-30
    • 2018-09-24
    • 2015-05-05
    • 1970-01-01
    • 2015-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-26
    相关资源
    最近更新 更多