Archived

This forum has been archived. Please start a new discussion on GitHub.

pb with python example

Hello,

I would like to run Minimal python example.

I have installes python2.4, IcePython, ... My os is windows xp, VC6

When I want to run Server.py, I have this message :
Traceback (most recent call last):
File "Server.py", line 1, in ?
import sys, traceback, Ice
File "C:\cygwin\Ice-3.0.1\python\Ice.py", line 15, in ?
import IcePy
ImportError: No module named IcePy

I check my path, python. I included the dlls, lib, ... I include also the path where Icepy.so is.

I don't know what to do !
I think it a path problem, but I can't solve it.

I thank you very much

Comments

  • matthew
    matthew NL, Canada
    What python are you using? The cygwin python? The plug-in hasn't been tested with cygwin python as far as I know. Please use the python as described in the README file -- http://www.python.org/download.

    If you are already using this then you must have setup the environment incorrectly. If you follow the directions in the README file it will definitely work. For more assistance you need to provide lots more information, such as your environment settings, the installation directories, etc.
  • I dowloaded python 2.4 (http://www.python.org/2.4/) for windows.
    I installed it in : C:\Python24

    I dowloaded Ice for Python. I installed in C:\IcePy-3.0.1

    I compile Ice for Python with visual c++ 6. No problems, the compilation is ok.

    After that, I set my variable environment.

    variable : ICEPY_HOME value : C:\IcePy-3.0.1
    variable : PYTHONPATH value : %ICEPY_HOME%\python

    I tried to follow the description in the install file.

    After that, I try to launch Server.py in the minimal example. I got the following error :
    Traceback (most recent call last):
    File "Server.py", line 11, in ?
    import sys, traceback, Ice
    File "..\..\..\python\Ice.py", line 15, in ?
    import IcePy
    ImportError: No module named IcePy

    I don't know what to do.

    Thank you for your help
  • matthew
    matthew NL, Canada
    What Ice for python distribution did you download? There is no binary distribution for Python that we provide that will work with a VC6 built Ice runtime. You should either download the source distribution and compile the python plugin yourself with VC6 or upgrade to VS2005 and use the http://www.zeroc.com//download/Ice/3.0/Ice-3.0.1-VC80.msi distribution which contains the Python extension DLL.
  • I dowloaded the source distribution for Python : IcePy-3.0.1.zip

    Is that wrong ?
  • matthew
    matthew NL, Canada
    Did you compile it? If not, then do that (read the INSTALL file). If you did then the Python extension DLL cannot be in your PATH.
  • yes, I compiled it ! There were no errors. All was ok !
  • this is my path :

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\IcePy-3.0.1\python;C:\Python24\Lib;C:\Python24\DLLs;C:\Python24;C:\Python24;C:\IcePy-3.0.1\python;


    Is it correct ?
  • matthew
    matthew NL, Canada
    What shell are you using? bash? If so, the environment variable syntax you are using is incorrect. I just tried with the IcePy source distribution under Bash with Python 2.4 on my XP box.

    matthew@october /c/src/IcePy-3.0.1/demo/Ice/hello
    $ export ICEPY_HOME=C:/src/IcePy-3.0.1

    matthew@october /c/src/IcePy-3.0.1/demo/Ice/hello
    $ export PYTHONPATH=$ICEPY_HOME/python

    matthew@october /c/src/IcePy-3.0.1/demo/Ice/hello
    $ python Client.py

    usage:
    t: send greeting as twoway
    o: send greeting as oneway
    O: send greeting as batch oneway
    d: send greeting as datagram
    D: send greeting as batch datagram
    f: flush all batch requests
    T: set a timeout
    S: switch secure mode on/off
    s: shutdown server
    x: exit
    ?: help

    ==>
  • I am using a dos window. I configure my path in the control panel...
  • matthew
    matthew NL, Canada
    Run a DOS window. Do:

    echo %PYTHONPATH%
    echo %PATH%

    And tell me the results.

    Check that IcePy.dll is in the IcePy-3.0.1\python directory, and that this directory is in the PYTHONPATH.
  • pythonpath :

    C:\IcePy-3.0.1\python;C:\IcePy-3.0.1\modules;C:\Python24\Lib;C:\Python24\DLLs;C:\Python24\libs;C:\IcePy-3.0.1\modules


    path :
    C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\IceJ-3.0.1\bin;C:\Horb\horb2.1\bin;C:\IcePy-3.0.1\python;C:\Python24\Lib;C:\Python24\DLLs;C:\Python24;C:\stage\Ice\python;C:\Python24;C:\Python24\DLLs;C:\Python24\libs;C:\Python24\Lib;C:\stage\Ice\python;C:\IcePy-3.0.1\python;C:\Python24\DLLs;C:\Python24\libs;C:\j2sdk1.4.2_04\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\IceJ-3.0.1\bin;C:\Horb\horb2.1\bin;C:\IcePy-3.0.1\python;C:\Python24\Lib;C:\Python24\DLLs;C:\Python24;C:\stage\Ice\python;C:\cygwin\Ice-3.0.1\Ice-3.0.1\lib;C:\cygwin\Ice-3.0.1\Ice-3.0.1\include;C:\Python24\DLLs;C:\Python24\libs;C:\Python24\Lib;C:\stage\Ice\python;C:\IcePy-3.0.1\python


    I don't have IcePy.dll but IcePy_d.dll in the IcePy-3.0.1\python directory.

    Maybe I have to compile Ice for python without debuging mode...
  • I solved the problem

    I compiled in release mode. I got IcePy.dll.

    I tried and it works perfectly.

    I thank you very very much for your help !!!

    You are a very nice guy !!!

    Thanks a lot !
  • matthew
    matthew NL, Canada
    Ah, glad you found the solution!