Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  pycplex121.so: undefined symbol Py_InitModule4

    Posted Sun June 27, 2010 05:39 PM

    Originally posted by: SystemAdmin


    Hello,

    I was unable to load the CPLEX Python API. It complains that there is an undefined symbol in pycplex121.so.

    % python
    Python 2.5.2 (r252:60911, Jan 20 2010, 23:14:04) 
    [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cplex
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/net/dorsal/apps/ilog/cplex121/python/x86-64_debian4.0_4.1/cplex/__init__.py", line 149, in <module>
        import callbacks
      File "/net/dorsal/apps/ilog/cplex121/python/x86-64_debian4.0_4.1/cplex/callbacks.py", line 47, in <module>
        from _internal._aux_functions import apply_freeform_two_args, apply_freeform_one_arg
      File "/net/dorsal/apps/ilog/cplex121/python/x86-64_debian4.0_4.1/cplex/_internal/__init__.py", line 19, in <module>
        import _list_array_utils
      File "/net/dorsal/apps/ilog/cplex121/python/x86-64_debian4.0_4.1/cplex/_internal/_list_array_utils.py", line 13, in <module>
        import _pycplex as CPX
      File "/net/dorsal/apps/ilog/cplex121/python/x86-64_debian4.0_4.1/cplex/_internal/_pycplex.py", line 22, in <module>
        import pycplex121
    ImportError: /net/dorsal/apps/ilog/cplex121/python/x86-64_debian4.0_4.1/cplex/_internal/pycplex121.so: undefined symbol: Py_InitModule4
    


    I also tried to build the API under Python 2.6, but ran into the same problem.

    I am using Ubuntu Linux 8.04 (hardy) on x86_64.

    Thanks,
    Carol
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: pycplex121.so: undefined symbol Py_InitModule4

    Posted Mon June 28, 2010 02:33 AM

    Originally posted by: SystemAdmin


    What version of Python did you use when the problem occurred?
    For the Python API in CPLEX 12.1 you need Python 2.4. Python 2.5 or 2.6 is not supported by CPLEX 12.1.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: pycplex121.so: undefined symbol Py_InitModule4

    Posted Mon June 28, 2010 03:39 AM

    Originally posted by: SystemAdmin


    Note that CPLEX 12.2 is compatible to Python 2.5 and 2.6. So, either you install Python 2.4 on your system, or you wait a little bit until CPLEX 12.2 becomes available for academics. You will not have to wait very long...

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: pycplex121.so: undefined symbol Py_InitModule4

    Posted Mon June 28, 2010 12:08 PM

    Originally posted by: SystemAdmin


    Errors of this type typically result from trying to load the 32-bit CPLEX Python module with a 64-bit version of python or vice versa. If you use the version of CPLEX built for 64-bit linux this problem should go away.

    As Tobias mentioned earlier, you will still run into the issue that Python 2.5 is not supported with CPLEX version 12.1, so you will either have to wait for the availability of CPLEX 12.2 or get Python 2.4 on the machine where you want to run the CPLEX Python API.

    Philip Starhill
    CPLEX Research Engineer
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: pycplex121.so: undefined symbol Py_InitModule4

    Posted Mon June 28, 2010 12:14 PM

    Originally posted by: SystemAdmin


    Actually, looking more closely at your error messages I see that you are using 64-bit CPLEX. I suspect that the Python runtime you are using is a 32-bit version, even though your system is 64-bit.

    Philip Starhill
    CPLEX Research Engineer
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: pycplex121.so: undefined symbol Py_InitModule4

    Posted Fri July 30, 2010 02:48 PM

    Originally posted by: SystemAdmin


    Thank you for your timely response. It was indeed due to the incompatibility between CPLEX 12.1 and Python 2.5. We installed CPLEX 12.2 and the Python API is now working.

    Sorry it took me a while to report back. We purchased a "always current" license from ILOG a while ago, and we had to jump through some hoops with the IBM Customer Service to get the version 12.2 download.

    Thanks,
    Carol
    #CPLEXOptimizers
    #DecisionOptimization