今天用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文件,然后覆蓋安裝目錄下同名文件,搞定
此記