Embedding pyqtgraph into existing C++ solution.

900 views
Skip to first unread message

Craig Mackay

unread,
Sep 10, 2014, 12:14:55 PM9/10/14
to pyqt...@googlegroups.com
I have a substantial C++ package for image capture and archive, and would like to display this using pyqtgraph.  Using the Python C/API I can run very simple python functions successfully.  However if I introduce at the beginning of the python code any or all of:
import numpy as np
import scipy
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph as pg

The calling C++ code routine crashes even though none of those functions are used in the python module (which was:

def mply():
    c = 12345*6789
    print 'The result of 12345 x 6789 :', c
    return c

To be honest I'm not even certain that this is actually a pyqtgraph problem but this community will be more familiar with these packages than most.

Craig Mackay

unread,
Sep 11, 2014, 7:33:00 AM9/11/14
to pyqt...@googlegroups.com
I have now managed to sort this out.  The problem is that the paths used by the Visual C++ 2012 package and the python packages are rather different.  You have to be careful to be running the C++ program essentially in or clearly linked to the location that the Python packages running.  This is well covered in a note by Amanda Birmingham (2004) entitled "A Python For Windows Tutorial".
Reply all
Reply to author
Forward
0 new messages