embedding python with mayavi into C

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

embedding python with mayavi into C

Kevin Khan
Hi there,

I have been experimenting with embedding python modules into C for the past couple of weeks.  However at this point in time I seemed to have run into a problem.  Let me explain how my python script works.  The python program contains a function which takes 112 numbers and generates a 2D colormap as well as a 3D mesh model (with the use of mayavi).

When I try to embed my python script into C I get a runtime error R6034.  Now I believe that this problem is linked to the fact that I am using mayavi in my python script.  The reason why I say this is because I have tested to embed this code in various stages.  I first tried testing to embed this code with just the 2D colormap (i.e. there is no 3D model generated and mayavi is not being imported).  This part worked out just fine.  My next test involved importing mayavi into the python script and creating a 3D mesh model.  This is where the issue arises.  When I try to embed this program this is where I get the runtime error.  However when I test the program by itself (just simply running the python script) it runs perfectly.

I am using Python 2.7.3 and Visual Studio 2012.

I wanted to know if any one has come across this problem in the past or if you know of any way to fix this problem.

Any help would be much appreciated,

Kevin

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: embedding python with mayavi into C

Christoph Gohlke
On 1/2/2013 7:32 AM, Kevin Khan wrote:

> Hi there,
>
> I have been experimenting with embedding python modules into C for the
> past couple of weeks.  However at this point in time I seemed to have
> run into a problem.  Let me explain how my python script works.  The
> python program contains a function which takes 112 numbers and generates
> a 2D colormap as well as a 3D mesh model (with the use of mayavi).
>
> When I try to embed my python script into C I get a runtime error
> R6034.  Now I believe that this problem is linked to the fact that I am
> using mayavi in my python script.  The reason why I say this is because
> I have tested to embed this code in various stages.  I first tried
> testing to embed this code with just the 2D colormap (i.e. there is no
> 3D model generated and mayavi is not being imported).  This part worked
> out just fine.  My next test involved importing mayavi into the python
> script and creating a 3D mesh model.  This is where the issue arises.
> When I try to embed this program this is where I get the runtime error.
> However when I test the program by itself (just simply running the
> python script) it runs perfectly.
>
> I am using Python 2.7.3 and Visual Studio 2012.
>
> I wanted to know if any one has come across this problem in the past or
> if you know of any way to fix this problem.
>
> Any help would be much appreciated,
>
> Kevin
>
>

Try to include a manifest for the Visual Studio 2008 C runtime library
with your executable. See
<http://msdn.microsoft.com/en-us/library/ms235560%28v=vs.90%29.aspx>.
The easiest is to compile your C code with Visual Studio 2008 instead of
2012.

Christoph
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev