2

I had created an application in Python and then I tried to make an executable from it. Works well in Ubuntu and Windows but only when on this system I have Python installed. In other case (Tried only for Win) I get the error that "The application can't start because python34.dll is missing"

What I do (filename is curr.py, also I have icon.res for icon):

  1. python C:\Python34\Scripts\cython-script.py --embed curr.py
  2. in curr.c replace wmain by main (without doing it app won't be compiled at all)
  3. gcc curr.c -o curr.exe -IC:\Python34\include -LC:\Python34\libs icon.res -lpython34 -mwindows --static

Of course, If I copy python34.dll to the app's folder everything is OK. Do I have another way?

GriMel
  • 2,272
  • 5
  • 22
  • 40
  • Is the directory containing python34.dll in %PATH%? – cdarke Jan 08 '15 at 22:51
  • Of course, there is. – GriMel Jan 09 '15 at 00:13
  • I could see something like [py2exe](http://www.py2exe.org/) being useful. – IanH Jan 09 '15 at 06:20
  • py2exe copies python34.dll, altogether with bunch of additional files. I suppose, there is no way to "pack" python34.dll – GriMel Jan 09 '15 at 14:12
  • Does this answer your question? [Minimal set of files required to distribute an embed-Cython-compiled code and make it work on any machine](https://stackoverflow.com/questions/62390978/minimal-set-of-files-required-to-distribute-an-embed-cython-compiled-code-and-ma) – ead Aug 10 '20 at 13:55

2 Answers2

0

Just installed PyInstaller - it has the option to compile to one file.

GriMel
  • 2,272
  • 5
  • 22
  • 40
0

What worked in My case is

download pyhton34.dll and paste it into
C:\Windows\System32 or
C:\Windows\syswow64, one of will definitely work.

Lokesh Tiwari
  • 10,496
  • 3
  • 36
  • 45