python - Cygwin、SWIG 和 Python

标签 python cygwin swig

我想使用我在 SWIG 中使用 Python 中的 Cygwin 创建的 DLL,但它在 cygwin 提供的 python 实现之外不起作用。这是怎么回事?当我在 cygwin 中时,我会:

  $python
    >>>import arraytest

而且效果很好。

当我将 DLL 移动到 python 3.2.3 的 python 路径(我使用的是 Windows)并尝试使用它时,出现此错误:

   ImportError: DLL load failed: The specified module could not be found.

我知道它位于正确的路径中,并且我正在以正确的方式引用它(因为否则我会收到“ImportError:没有名为...的模块”错误。

我需要这个 DLL 可以在任何 Python 平台上使用,所以如果 cygwin 创建的 DLL 只能由 cygwin 使用,请告诉我!

最佳答案

我认为 Cygwin Python 和 Windows 的标准(MSVC 编译)Python 不能同时使用单个 DLL。您可能应该分发两个不同的 DLL,或者仅使用 MSVC Express 来构建 DLL。

关于python - Cygwin、SWIG 和 Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11613852/

相关文章:

python - 为 pip 格式化 requirements.txt 文件,其中一个或多个包具有不同的索引 url

python - 无法在Python脚本上拖动文件

python - Numpy 和 Scipy 与 Amazon Elastic MapReduce

python - 将 SQLAlchemy 与复合主键和外键一起使用

bash - 即使管道不接受输入,也同时输出到管道和文件

c++ - 使用 cygwin 编译 C++ 不搜索提供的包含路径

c++ - 如何通过 SWIG 将 lua 嵌入到 C++ 中

git,远程访问 - ssh

java - 如何通过Swig将带有数据的std::vector <UserDefinedClass>传递给Java?

python - QuickFix Python API - 可以在 Python 中子类化 MessageStoreFactory 吗?