Opened 3 years ago

Closed 4 months ago

#70 closed installation issue (migrated)

Error for python interface

Reported by: hdminh Owned by: ferreau
Priority: normal Milestone:
Component: python interface Version: 3.2.1
Keywords: Cc:


I got the following error for python interface
(python 2.7.13, Ubuntu/Linux? 16.04, 64bits)
python ../examples/
Traceback (most recent call last):

File "../examples/", line 27, in <module>

from qpoases import PyQProblem as QProblem

ImportError?: /home/minh/miniconda2/envs/newton/lib/python2.7/site-packages/ undefined symbol: _ZN7qpOASES9QProblemBC1EiNS_11HessianTypeENS_11BooleanTypeE

Thanks, Minh

Change History (3)

comment:1 Changed 3 years ago by jonrkarr

I'm also having the same issue with qpOASES 3.2.1, Python 2.7.12 and 3.6.3, numpy 1.13.1, and Ubuntu 16.04.

I compiled using these commands:

cd /tmp
tar -xvvf qpOASES-3.2.1.tgz
cd qpOASES-3.2.1
cd interfaces/python
python build_ext --inplace

Then I try to import qpoases:

python -c "import qpoases"

This produces this error on Python 2.7 (I also get a similar error with Python 3.6):

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: ./ undefined symbol: _ZN7qpOASES8QProblemC1EiiNS_11HessianTypeENS_11BooleanTypeE

Any help would be greatly appreciated!

comment:2 Changed 2 years ago by pmoran

The C++ library seems to be compiled with long, but the cython interface is just using int. I had a quick hack but couldn't get cython to use long as well. However, you can make C++ use int instead of long... I'm not sure what the deeper ramifications might be but it's working okay for me.

In, search for CPPFLAGS and delete "-DUSE_LONG_INTEGERS"

Be sure to make clean and remove the compiled python build directory and cython .so before recompiling.

comment:3 Changed 4 months ago by stefan

  • Resolution set to migrated
  • Status changed from new to closed

This ticket has been migrated to GitHub and will be resolved there:

Note: See TracTickets for help on using tickets.