python调用ice接口

今天用python调用ice接口,遇到如下提示

ImportError: No module named Ice

解决方案是

set PYTHONPATH=C:\Program Files\ZeroC\Ice-3.4.1\python

然后又提示

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

在网上看到别人是如下配置即可

C:\> set PATH=C:\Python26;C:\Program Files\ZeroC\Ice-3.4.1\bin;%PATH%
C:\> set PYTHONPATH=C:\Program Files\ZeroC\Ice-3.4.1\python
C:\> python
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Ice
>>>

我的Python是2.7,ICE是3.5.0,按如上操作后,还是提示IcePy,DLL找不到

有人提到可能是版本不对应,于是下载ICE源码,按工程中说明将PY模块重新编译,得到IcePy.pyd文件,然后覆盖安装目录下同名文件,搞定

 

此记

posted @ 2014-12-02 12:58  fatterbetter  阅读(4908)  评论(3编辑  收藏  举报