problem running embedded cython program

171 views
Skip to first unread message

paomo

unread,
Feb 15, 2012, 1:45:19 PM2/15/12
to cython-users
Hi all,

I managed to compile the embedded.pyx program into a *.exe using the --
embed feature of cython. The program runs fine at the compiled
location. But after I move the *.exe file to a different folder on
the same computer, it won't run, with the error box:

"The program can't start because MSVCR90.dll' is missing from your
compute. Try reinstalling the program to fix this problem."

I am on windows 7 64bit.

Any one has suggestions?

Thanks


Chris Barker

unread,
Feb 15, 2012, 6:16:23 PM2/15/12
to cython...@googlegroups.com
On Wed, Feb 15, 2012 at 10:45 AM, paomo > "The program can't start

because MSVCR90.dll' is missing from your
> compute.  Try reinstalling the program to fix this problem."

That's the runtime lib from Visual Studio 9 (VS 2008, I think). Python
itself requires it, as do a lot of other programs.

I suspect that this is a very clean machine -- with little installed.

Anyway, it's a mystery to me why MS doesn't deliver their own runtime
libs with the OS, but they don't -- so you'll need install that dll --
it should be in the Windows python installation somewhere, as well an
a million other places.

Sorry -- no Windows box in front of me to point you to exactly where.

-Chris

> I am on windows 7 64bit.
>
> Any one has suggestions?
>
> Thanks
>
>

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

paomo

unread,
Feb 15, 2012, 10:02:02 PM2/15/12
to cython-users
Thanks Chris. I fixed the problem by removing compiler option /MD
that required the dependency. However, there is another non-windows
problem. My embedded program depends on another *.pxd file in the
same directory that I compiled the embedded.pyx. Again the program
runs fine in the compilation directory, but if I move the program to a
different directory (along with the *.pxd file that it depends on), it
crashes with error:

File "embedded.pyx", line 25, in init embedded (embedded.c:1069)
ImportError: DLL load failed: The specified module could not be found.

Any suggestions? Thanks.
> Chris.Bar...@noaa.gov

mark florisson

unread,
Feb 16, 2012, 6:54:18 AM2/16/12
to cython...@googlegroups.com
On 16 February 2012 03:02, paomo <jiao...@gmail.com> wrote:
> Thanks Chris.  I fixed the problem by removing compiler option /MD
> that required the dependency.  However, there is another non-windows
> problem.  My embedded program depends on another *.pxd file in the
> same directory that I compiled the embedded.pyx.  Again the program
> runs fine in the compilation directory, but if I move the program to a
> different directory (along with the *.pxd file that it depends on), it
> crashes with error:
>
>  File "embedded.pyx", line 25, in init embedded (embedded.c:1069)
> ImportError: DLL load failed: The specified module could not be found.
>
> Any suggestions?  Thanks.
>

The pxd itself is a compile time thing. If you move one module
(embedded or otherwise) over to another location, you also need to
make sure python can find the module it depends on. When you share
things through pxd files, Cython tries to import those things (like
cdef functions, extension classes etc) from the module. The easiest
thing is to copy it over with the program.

paomo

unread,
Feb 16, 2012, 7:45:57 AM2/16/12
to cython-users


On Feb 16, 6:54 am, mark florisson <markflorisso...@gmail.com> wrote:
> On 16 February 2012 03:02, paomo <jiaoy...@gmail.com> wrote:
>
> > Thanks Chris.  I fixed the problem by removing compiler option /MD
> > that required the dependency.  However, there is another non-windows
> > problem.  My embedded program depends on another *.pxd file in the
> > same directory that I compiled the embedded.pyx.  Again the program
> > runs fine in the compilation directory, but if I move the program to a
> > different directory (along with the *.pxd file that it depends on), it
> > crashes with error:
>
> >  File "embedded.pyx", line 25, in init embedded (embedded.c:1069)
> > ImportError: DLL load failed: The specified module could not be found.
>
> > Any suggestions?  Thanks.
>
> The pxd itself is a compile time thing. If you move one module
> (embedded or otherwise) over to another location, you also need to
> make sure python can find the module it depends on. When you share
> things through pxd files, Cython tries to import those things (like
> cdef functions, extension classes etc) from the module. The easiest
> thing is to copy it over with the program.
>
>

I did copy the .pyd file to the same folder as the .exe file, but it
gave the error in my previous post. Interestingly, the error is
different if I did not copy it over along with the .exe file:

File "embedded.pyx", line 25, in init test_main.embedded (embedded.c:
1069)
ImportError: No module named helper

Here is the content of my helper.pyx:
def printer(x):
print x
print '-------'

mark florisson

unread,
Feb 16, 2012, 8:25:53 AM2/16/12
to cython...@googlegroups.com

And is the directory containing your exe and .pyd module in sys.path?

paomo

unread,
Feb 16, 2012, 10:49:51 AM2/16/12
to cython-users


On Feb 16, 8:25 am, mark florisson <markflorisso...@gmail.com> wrote:
Yes it is. Actually, if I copy over the "main.exe.manifest" file that
the msft compiler produces with the EXE file, it runs that the new
location. apparently that file is supposed to describe the
dependencies of the EXE file, so the failure I mentioned previously is
likely triggered by dependency on some windows dll, not my
helper.pyd. this question is not about cython anymore - but does
anyone know how to get ride of the *.manifest file?
Reply all
Reply to author
Forward
0 new messages