Problem when import IcePy in Ice 3.1.1

rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
I have installed python2.5 at c:\AppSoft\python25 and Ice 3.1.1 at C:\AppSoft\Ice-3.1.1. However, it seems that they use different compilers and are not compatible:
C:\>set pythonpath=C:\AppSoft\Ice-3.1.1\python
C:\>echo %path%
.;C:\AppSoft\Python25\;C:\AppSoft\apache-ant-1.6.5\bin;C:\AppSoft\Ice-3.1.1\bin;C:\AppSoft\Sun\jdk\bin;c:\AppSoft\ora92\
bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOW
S\System32\Wbem;C:\AppSoft\SecureCRT\;C:\Program Files\IDM Computer Solutions\UltraEdit-32;C:\AppSoft\Sun\bin;C:\AppSoft
\UltraCompare

C:\>dir %pythonpath%\IcePy.dll
2006-10-11  03:39           331,776 IcePy.dll

C:\>dir C:\AppSoft\Ice-3.1.1\python\IcePy.dll
2006-10-11  03:39           331,776 IcePy.dll

C:\>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', 'C:\\AppSoft\\Ice-3.1.1\\python', 'C:\\WINDOWS\\system32\\python25.zip', 'C:\\AppSoft\\Python25\\DLLs', 'C:\\AppSof
t\\Python25\\lib', 'C:\\AppSoft\\Python25\\lib\\plat-win', 'C:\\AppSoft\\Python25\\lib\\lib-tk', 'C:\\AppSoft\\Python25'
, 'C:\\AppSoft\\Python25\\lib\\site-packages']
>>>
[COLOR="Blue"]>>> import Ice
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\AppSoft\Ice-3.1.1\python\Ice.py", line 30, in <module>
    import IcePy
ImportError: No module named IcePy
>>>[/COLOR][COLOR="Red"]>>> import IcePy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named IcePy
>>>[/COLOR]

Before the update, I use Python2.4 and Ice3.1.0, they are compatible, that is, when I "import IcePy", no error occurs.

Comments

  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    I have found another link: http://www.zeroc.com/vbulletin/showthread.php?t=2175

    Does it mean I have to compile python25 or IcePy.dll myself ?
  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    I know now:)

    1. From %ICEPY_HOME%\CHANGES:
    Changes since version 3.1.0
    ---------------------------
    
    - Added compatibility with Python 2.5.
    
    - Fixed a bug with the IceGrid allocate and sessionAllocation demos 
      where the session would not be destroyed in the event of an 
      allocation failure.
    
    - Restored Communicator::setDefaultContext.
    
    

    It seems that Ice 3.1.0 support Python 2.5.


    2. However, from %ICEPY_HOME%\INSTALL:
    =========================================================================
    Requirements
    =========================================================================
    
    - Ice 3.1.1
    - Python 2.3 or 2.4 built with a C++ compiler compatible with C++
      compiler used to build Ice for C++.
    
    Depending on your platform, you may need to download the Python source
    distribution from http://www.python.org and make our own Python build.
    
    You can use the Ice for C++ binary distribution for your platform to
    build the Ice extension for Python.
    

    It requires Python2.3 or 2.4, so it does not suport Python 2.5.

    3. Finally, if I change my path to:
    c:\set path=c:\AppSoft\python24;%path%
    [code]
    
    "import IcePy" works:
    [code]
    C:\>python
    Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import IcePy
    

    Sorry for my bothering:)
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    The binary versions were compiled against 2.4. If you want to use 2.5 you have to compile yourself from source.
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    3.1.1 is a patch release, and you should be able to just replace 3.1.0 by 3.1.1 without changing anything else. We can't change the Python version is such a release.

    Cheers,
    Bernard
  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    bernard wrote:
    3.1.1 is a patch release, and you should be able to just replace 3.1.0 by 3.1.1 without changing anything else. We can't change the Python version is such a release.

    Thank you, I know now:)
  • cesarecesare Member Cesare Di MauroOrganization: A-TonoProject: Cafemobile
    I got the same problem:
    Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Ice
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Program Files (x86)\Ice-3.1.1\Python\Ice.py", line 30, in <module>
        import IcePy
    ImportError: No module named IcePy
    
    But I can't build a new IcePy.dll version, because I only have Visual Studio C++ 2005 Express Edition and Python 2.5 was compiled against Visual Studio 2003 (VC 7.1) and every extension need to use the same compiler.

    I use several other extensions for my projects, which are a bit difficult to recompile (and the source code for one, http://starship.python.net/crew/kernr/mingw32/Py-mingw32-tools.zip, is not available), so recompiling everything will be a pain for me.

    Any idea?

    Thanks a lot
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    If you cannot recompile Ice for Python, then I'm afraid your only option is to downgrade to Python 2.4. Otherwise, if you would like us to provide you with a version for Python 2.5, please contact us at [email protected] for consulting services.
  • cesarecesare Member Cesare Di MauroOrganization: A-TonoProject: Cafemobile
    After installing Ice 3.1.1 VC71, do I need to recompile (and install) only the IcePy source archive?
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    cesare wrote:
    After installing Ice 3.1.1 VC71, do I need to recompile (and install) only the IcePy source archive?
    Yes, if you have VS 2003 you can build the IcePy source archive. Follow the instructions in the INSTALL file included in the archive.

    Take care,
    - Mark
  • cesarecesare Member Cesare Di MauroOrganization: A-TonoProject: Cafemobile
    I've:
    - installed VS 2003 (Italian version), Ice 3.2.0 VC71 (in C:\Ice-3.2.0\ ) and Python 2.5 (in C:\Python25\ );
    - decompressed IcePy 3.2.0 in C:\IcePy-3.2.0\ ;
    - defined the environment variables (ICEPY_HOME=C:\IcePy-3.2.0, ICE_HOME=C:\Ice-3.2.0, PYTHONPATH=C:\IcePy-3.2.0\python);
    - opened a "Visual Studio Command Prompt";
    - executed vcvars32.bat script;
    - changed path to C:\IcePy-3.2.0 ;
    - edited config\Make.rules.mak putting VC71 as compiler;
    - ran "nmake /f Makefile.mak"

    but the make failed with the following message:
    Microsoft (R) Program Maintenance Utility   versione 7.10.3077
    Copyright (C) Microsoft Corporation. Tutti i diritti riservati.
    
    "making all in python"
            "C:\Ice-3.2.0\bin\slice2py.exe" -I"C:\Ice-3.2.0\slice" --ice --prefix Ice_ --no-package C:\Ice-3.2.0\slice/Ice/LocalException.ice
    ""C:\Ice-3.2.0\bin\slice2py.exe"" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch.
    NMAKE : fatal error U1077: ""C:\Ice-3.2.0\bin\slice2py.exe"" : codice restituito "0x1"
    Stop.
    NMAKE : fatal error U1077: "for" : codice restituito "0x1"
    Stop.
    
    It seems that C:\Ice-3.2.0\bin\slice2py.exe can't be found and executed.

    Everything under Windows Vista Ultimate x64 with last patches updated, and with Administrator priviledge rights.

    The same applies after installing SP1 for Visual Studio 2003.

    Somebody have any idea to solve the problem? Thanx a lot in advance.
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    The slice2py executable is only included in the Visual Studio 2005 distribution of Ice. If you want to build Ice for Python using VS 2003, you will need to build at least some of the Ice for C++ source distribution. For example, after you extract the source files in Ice-3.2.0.zip, you can do the following:

    > cd Ice-3.2.0-src
    > cd src
    > nmake /f Makefile.mak

    Review the INSTALL.WINDOWS file in the source distribution for complete instructions.

    Take care,
    - Mark
  • cesarecesare Member Cesare Di MauroOrganization: A-TonoProject: Cafemobile
    Thank you so much. Now I have an Ice 3.2 version which works (almost) well with Python 2.5 (which was my primary need).

    There's only a problem I noticed: after uninstalled Visual Studio 2003, slice2py.exe ceased to work: now a dialog appears telling that MSVCR71D.dll was not found, and the application aborts. I copied this library in C:\Ice-3.2.0\bin but the nothing changed.

    It seems that the applications were built against debug versions of the libraries, but I haven't changed any option in the makefile other than which compiler version to use.

    Any idea?

    Thanks in advance,
    Cesare
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    The default build system for Ice-for-C++ is "debug". If you want to build "release", you need to set OPTIMIZE to yes before building, e.g.

    > set OPTIMIZE=yes
    > nmake -f Makefile.mak

    Cheers,
    Bernard
  • cesarecesare Member Cesare Di MauroOrganization: A-TonoProject: Cafemobile
    Everything worked fine now. Thanks a lot!!! :)
Sign In or Register to comment.