Problem with python api


#1

Hello,

I’m experimenting with SciDB’s python API and getting an error when trying sample.py:

$ /usr/bin/python pythonexamples/sample.py 
Executing: select * from simplearray
Traceback (most recent call last):
  File "pythonexamples/sample.py", line 129, in <module>
    main()
  File "pythonexamples/sample.py", line 77, in main
    desc = result.array.getArrayDesc()
AttributeError: 'SwigPyObject' object has no attribute 'getArrayDesc'
$

The problem doesn’t seem to care whether I run from $BUID/bin/pythonexamples or $PREFIX/share/scidb/examples/python . It appears that “result” is a lisbscidbpython.QueryResult and result.array is a “<Swig Object of type 'boost::shared_ptr< scidb::Array >*”. My guess is that result.array should be a libscidbpython.Array.

I’m not sure what went wrong. Does anyone have an idea?

Thanks,
-Daniel


#2

Hi,

I guess the problem is resolved by now. But since I just had the same issue I decided to post a reply in case somebody else is looking. The thing is that you have to build the Python driver with the version of Swig at least 2.0.0. Smart pointers do not work in earlier versions. I had 1.3.40 and using a recent version helped. It would be nice if the CMake script checked the version by itself.

Best,
Alex