John Hunter <jdh2...@gmail.com> schrieb am 16.11.2009 15:14:31:
> On Mon, Nov 16, 2009 at 6:16 AM, <markus.proel...@ifm.com> wrote:
> >
> > Hello everyone,
> >
> > I use the following C-Code in visual studio 2005 (I start the program
with
> > "Release" configuration):
> >
> > #include <Python.h>
> > #include <iostream>
> > using namespace std;
> >
> > void main()
> > {
> > Py_Initialize();
> >
> > while (1)
> > {
> > char test[100] = {};
> > cout<<">>> ";
> > cin.getline(test, 100);
> > PyRun_SimpleString(test);
> >
> > }
> >
> > Py_Finalize();
> > }
> >
> > for my first tries to embed python in C.
> > However if I try to import pylab (from pylab import *) I get the
following
> > error:
> >
> >>>> from pylab import *
> > Traceback (most recent call last):
> > File "<string>", line 1, in <module>
> > File "C:\Python26\lib\site-packages\pylab.py", line 1, in <module>
> > from matplotlib.pylab import *
> > File "C:\Python26\lib\site-packages\matplotlib\pylab.py", line 206,
in
> > <module>
> > from matplotlib import mpl # pulls in most modules
> > File "C:\Python26\lib\site-packages\matplotlib\mpl.py", line 1, in
> > <module>
> > from matplotlib import artist
> > File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
in
> > <module>
> > from transforms import Bbox, IdentityTransform, TransformedBbox,
> > TransformedPath
> > File "C:\Python26\lib\site-packages\matplotlib\transforms.py", line
34, in
> > <module>
> > from matplotlib._path import affine_transform
> > ImportError: DLL load failed: Eine DLL-Initialisierungsroutine ist
> > fehlgeschlagen.
>
> What version of matplotlib are you using? There were some linker
> problems with 0.98.x similar to the ones you are showing with
> python2.6, but these should be solved with 0.99.x. Also, I wouldn't
> recommend importing pylab or pyplot if you are going to try embedding
> mpl in C. You should use the API -- what you are trying is difficult
> enough w/o dealing with some of the pylab magic like runtime backend
> detection.
I have version 0.99.1 of matplotlib.
With Windows XP and Python 2.6.2
My first thought was also that there might be a linker problem.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users