1

I have python3.5 with a 64 bit machine. I have project with multiple .py files and there is one main file which runs the whole code using other .py file in the same directory. I want to convert it into .exe file so that I can the code on systems which does not have python installed in it. Pyinstaller is one option I searched and I installed but somehow when I run the command

pyinstaller --onefile main.py

on the command prompt windows. It returns

failed to create process.

I don't whether I am using it incorrectly or it is incompatible. But i was installed correctly for sure. Any suggestions to make it work or how can I make my code executable to all systems in an easy way ? Thanks

So, after correcting quotes problem I run the command again and there were a huge list of error which I don't even recognize :( I am pasting a part of those errors for the reference.

485 INFO: PyInstaller: 3.2
485 INFO: Python: 3.5.2
485 INFO: Platform: Windows-10-10.0.14393-SP0
501 INFO: wrote C:\Users\***********\PycharmProjects\MyfirstProject\ErrorCorrection.spec
501 INFO: UPX is not available.
523 INFO: Extending PYTHONPATH with paths
['C:\\Users\\***********\\PycharmProjects\\MyfirstProject',
 'C:\\Users\\***********\\PycharmProjects\\MyfirstProject']
523 INFO: checking Analysis
523 INFO: Building Analysis because out00-Analysis.toc is non existent
523 INFO: Initializing module dependency graph...
538 INFO: Initializing module graph hooks...
538 INFO: Analyzing base_library.zip ...
9993 INFO: running Analysis out00-Analysis.toc
10282 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python.exe
10367 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python.exe
10483 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python.exe
10551 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python.exe
10635 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python.exe
10852 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\VCRUNTIME140.dll
10914 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\VCRUNTIME140.dll
10999 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\VCRUNTIME140.dll
11083 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\VCRUNTIME140.dll
11152 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\VCRUNTIME140.dll
12518 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
12603 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
12672 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
12741 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
12839 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
12904 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
12989 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
13058 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
13174 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
13258 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
13339 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll
13405 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\***********\appdata\local\programs\python\python35\python35.dll

and finally after the huge list of errors it says:

pywintypes.error: (5, 'EndUpdateResource', 'Access is denied.')
Community
  • 1
  • 1
muazfaiz
  • 4,611
  • 14
  • 50
  • 88
  • Have you tried py2exe? You can check it out here http://www.py2exe.org/ and if you have any questions I'll be glad to help. – zipa Nov 14 '16 at 16:43
  • I installed py2exe and run that but it says it requires python 2.7. – muazfaiz Nov 14 '16 at 16:46
  • Now I see that :) How did you install `pyinstaller` as it seems to have `pip` related issues? If so, here might be your solution http://stackoverflow.com/questions/31808180/installing-pyinstaller-via-pip-leads-to-failed-to-create-process – zipa Nov 14 '16 at 16:59
  • @Boris Thanks. I have edited the above question with the error now I am getting. I don't know why it is occurring. Can you help in this ? – muazfaiz Nov 14 '16 at 17:43

2 Answers2

0

I also have this problem, I write a code using PyQt5.the code is right, but when I use the pyinstaller to convert it, something wrong appears, So I find a way you can try it.use commands to tell the locations.

pyinstaller --paths D:\Python\Lib\site-packages\PyQt5\Qt\bin -F -w ***.py

Teddy Z.P.J.
  • 101
  • 3
0

i search on c:\ for api-ms-win-crt-*.dll

then i copied all found api-ms-win-crt-*.dll files to a new folder c:\python\dlls

in my make.bat i add this line to expand the path

set path=%path%;c:\python\dlls

pyinstaller ....

and it works

gsxr1300
  • 351
  • 2
  • 4
  • 12