easy_install M2Crypto 在 Windows 平台上失败

发布于 2024-11-16 09:06:29 字数 694 浏览 5 评论 0原文

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

I am attempting to install M2Crypto on a Windows XP platform. I have Python, easy_install and SWIG installed, but when I attempt to easy_install M2Crypto I get the following:

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

I have read elsewhere that people have suggested easy_install openssl-devel, but that simply tells me that there are no packages found with that name. Is the name perhaps case-sensitive (I've tried various permutations without success), or does that advice not apply to Windows?

I'm not looking for alternatives to M2Crypto. I am picking up some existing code that uses it, so I need to get my development environment to be able to run what's already written.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那支青花 2024-11-23 09:06:29

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

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

对我来说就像一个魅力。

As jay stated in his answer you should try to build it from source. And I tried. The setup.py does not recognize the --openssl option. Looking at the output from the default setup.py I realized that the search location was c:\pkg and not c:\pkg\openssl.
The solution:

  1. Download and install OpenSSL from Win32 OpenSSL
  2. Copy the lib and include folders to c:\pkg
  3. Check that swig.exe is available in your path
  4. Run easy_install M2Crypto

Worked for me like a charm.

眉黛浅 2024-11-23 09:06:29

有类似的问题。下载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.

Had a similar problem. After downloading the source package of M2Crypto and reading the INSTALL file I found the following:

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文