gpt4 book ai didi

windows - easy_install M2Crypto 在 Windows 平台上失败

转载 作者:可可西里 更新时间:2023-11-01 13:51:12 26 4
gpt4 key购买 nike

我正在尝试在 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 的替代品。我正在挑选一些使用它的现有代码,所以我需要让我的开发环境能够运行已经编写的代码。

最佳答案

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

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

对我来说就像一个魅力。

关于windows - easy_install M2Crypto 在 Windows 平台上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6436771/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com