Exe Not working on different PCs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Exe Not working on different PCs

Stephen Parkes
Hi Guys,
I've successfully created an exe of my python program using pyinstaller. Its an application built using PyQt5 and I'm using Python 3.9. It works perfectly on 3 PCs in my office, but when deployed to some PCs it doesn't run.
All PC's were running Win10, some had python installed, some didn't.

I've tried running it from command line on the PCs that don't work, and nothing is printed in the output. I also tried to compile it with debug switched on and exectly the same information is printed to the command line on all PCs. On PCs where the program runs successfully the UI loads, the others it just stops with no errors.

I've tried inserting print statements to see where it gets to but it doesn't get that far. As no errors can be found I'm really after a way to debug the problem as I'm stumped.
Any advice on how to source the problem or what could be the difference between the machines would be much appreciated.
Cheers

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/8c1f2a5f-54a3-423e-aa17-5fb7f7d3f15cn%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Exe Not working on different PCs

bwoodsend
Running on one PC but not another usually translates as missing a DLL which some PCs have already. Are you using Conda? That's a common culprit. And what's your PyInstaller version?

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/56c995a7-e415-47cc-a6e6-473d499f5138n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Exe Not working on different PCs

Stephen Parkes

Thanks for your fast response. I’m not using Conda, standard python. Pyinstaller version 4.1.

Is there a way to detect what DLL is missing when no error is printed? Or where should I be comparing the dll’s between working and not working PCs.

Cheers,

 

 

From: [hidden email] <[hidden email]> On Behalf Of bwoodsend
Sent: Saturday, 22 May 2021 3:59 AM
To: PyInstaller <[hidden email]>
Subject: [PyInstaller] Re: Exe Not working on different PCs

 

Running on one PC but not another usually translates as missing a DLL which some PCs have already. Are you using Conda? That's a common culprit. And what's your PyInstaller version?

--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/A-aqJ8JIpdE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/56c995a7-e415-47cc-a6e6-473d499f5138n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/014501d74e93%24aa4d2320%24fee76960%24%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

RE: Exe Not working on different PCs

Steve Barnes
In reply to this post by Stephen Parkes

Most likely is a missing (but commonly found) DLL on those machines that it doesn't run on - the most likely candidates being those in the MS Redistribable.

 

One trick that I have found to help is to build the application with a second target set as command line  rather than Windows - this results  in an executable with the annoying habit of opening a command prompt when running but prevents some of the error messages being shunted to NUL - it is worth a try at least. Another is to try, on one of the machines where your app doesn't run it to try installing python (with it added to the path) then see if your code runs, if it doesn't try pip installing the python packages one by one until it does.

 

Steve Barnes

 

From: [hidden email] <[hidden email]> On Behalf Of Stephen Parkes
Sent: 21 May 2021 13:41
To: PyInstaller <[hidden email]>
Subject: [PyInstaller] Exe Not working on different PCs

 

Hi Guys,

I've successfully created an exe of my python program using pyinstaller. Its an application built using PyQt5 and I'm using Python 3.9. It works perfectly on 3 PCs in my office, but when deployed to some PCs it doesn't run.

All PC's were running Win10, some had python installed, some didn't.

 

I've tried running it from command line on the PCs that don't work, and nothing is printed in the output. I also tried to compile it with debug switched on and exectly the same information is printed to the command line on all PCs. On PCs where the program runs successfully the UI loads, the others it just stops with no errors.

 

I've tried inserting print statements to see where it gets to but it doesn't get that far. As no errors can be found I'm really after a way to debug the problem as I'm stumped.

Any advice on how to source the problem or what could be the difference between the machines would be much appreciated.

Cheers

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/8c1f2a5f-54a3-423e-aa17-5fb7f7d3f15cn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/VI1PR03MB6575149B5A8ADC19C33DDBD09B289%40VI1PR03MB6575.eurprd03.prod.outlook.com.
Reply | Threaded
Open this post in threaded view
|

Re: Exe Not working on different PCs

Eric Fahlgren
In reply to this post by Stephen Parkes
Have you ever used the venerable Dependency Walker?  It's ancient, but it still works for me on Win 10, although it sometimes takes 5-10 minutes to start up these days.  Since it's just two files (depends.exe and depends.dll, the .chm is just help so you can ignore it), you can easily put it on a USB stick and run it on one of the affected machines.


On Sat, May 22, 2021 at 7:29 AM <[hidden email]> wrote:

Thanks for your fast response. I’m not using Conda, standard python. Pyinstaller version 4.1.

Is there a way to detect what DLL is missing when no error is printed? Or where should I be comparing the dll’s between working and not working PCs.

Cheers,

 

 

From: [hidden email] <[hidden email]> On Behalf Of bwoodsend
Sent: Saturday, 22 May 2021 3:59 AM
To: PyInstaller <[hidden email]>
Subject: [PyInstaller] Re: Exe Not working on different PCs

 

Running on one PC but not another usually translates as missing a DLL which some PCs have already. Are you using Conda? That's a common culprit. And what's your PyInstaller version?

--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/A-aqJ8JIpdE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/56c995a7-e415-47cc-a6e6-473d499f5138n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/014501d74e93%24aa4d2320%24fee76960%24%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CAP2Qz%2BWFWgxAFnH%2B-Z8Yc_G1CamURB2odsNADwNL%3DWwYRUZx6g%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Exe Not working on different PCs

bwoodsend

We’ve recently had to expand the list of Windows DLLs to be collected by default. The new ones to look out for are:

  • msvcp140_1.dll
  • msvcp140_2.dll
  • vcruntime140_1.dll
  • vcomp140.dll

I’d guess that it’s either one of those or one of the tiny win-crt-api.dll DLLs.

I’d ditto the suggestion to try using Dependency Walker. Or you can use psutil. Put this at the end of your code:

import psutil

# Get this process i.e. Python.
process = psutil.Process()

# Print all loaded DLLs.
for i in process.memory_maps():
    print(i.path)

In either case, there will be a fair amount of sifting through file names and guess work required to find the DLL you don’t have.

On Saturday, May 22, 2021 at 7:28:56 PM UTC+1 [hidden email] wrote:
Have you ever used the venerable Dependency Walker?  It's ancient, but it still works for me on Win 10, although it sometimes takes 5-10 minutes to start up these days.  Since it's just two files (depends.exe and depends.dll, the .chm is just help so you can ignore it), you can easily put it on a USB stick and run it on one of the affected machines.


On Sat, May 22, 2021 at 7:29 AM <[hidden email]> wrote:

Thanks for your fast response. I’m not using Conda, standard python. Pyinstaller version 4.1.

Is there a way to detect what DLL is missing when no error is printed? Or where should I be comparing the dll’s between working and not working PCs.

Cheers,

 

 

From: [hidden email] <[hidden email]> On Behalf Of bwoodsend
Sent: Saturday, 22 May 2021 3:59 AM
To: PyInstaller <[hidden email]>
Subject: [PyInstaller] Re: Exe Not working on different PCs

 

Running on one PC but not another usually translates as missing a DLL which some PCs have already. Are you using Conda? That's a common culprit. And what's your PyInstaller version?

--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/A-aqJ8JIpdE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/56c995a7-e415-47cc-a6e6-473d499f5138n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/014501d74e93%24aa4d2320%24fee76960%24%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/060c8412-7fc9-4877-9cce-2d42f7b1134en%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Exe Not working on different PCs

Stephen Parkes

Thanks for your help everyone I now have the exe working all PC’s.

I tried DependencyWalker which didn’t find anything useful, but using psutil was able to find the missing DLL’s and pyd files.

Numpy and GDAL (osgeo) were the source of the missing libraries. I’m using numpy +mkl 1.19.4 downloaded from Christoph Gohlke’s page and

GDAL 3.2.1 from the same site.

In both cases some but not all required libraries were collected during the build, ones not collected were:

 

numpy\DLLs\mkl_def.dll

numpy\DLLs\mkl_core.dll

numpy\DLLs\mkl_vml_def.dll

numpy\DLLs\mkl_intel_thread.dll – the exe didn’t run on any PC without this DLL

numpy\DLLs\mkl_vml_def.dll

numpy\DLLs\libiomp5md.dll

numpy\DLLs\tbbmalloc.dll

osgeo\_osr.cp39-win_amd64.pyd

osgeo\_ogr.cp39-win_amd64.pyd

osgeo\_gdalconst.cp39-win_amd64.pyd

 

The osgeo\data\proj folder is also NOT copied during the build.

 

Was also missing

tcl\reg1.3\tclreg13.dll

 

Not sure if all these were required, but I included all these as “datas” for my build.

 

Cheers,

 

From: [hidden email] <[hidden email]> On Behalf Of bwoodsend
Sent: Monday, 24 May 2021 9:08 AM
To: PyInstaller <[hidden email]>
Subject: Re: [PyInstaller] Re: Exe Not working on different PCs

 

We’ve recently had to expand the list of Windows DLLs to be collected by default. The new ones to look out for are:

  • msvcp140_1.dll
  • msvcp140_2.dll
  • vcruntime140_1.dll
  • vcomp140.dll

I’d guess that it’s either one of those or one of the tiny win-crt-api.dll DLLs.

I’d ditto the suggestion to try using Dependency Walker. Or you can use psutil. Put this at the end of your code:

import psutil
 
# Get this process i.e. Python.
process = psutil.Process()
 
# Print all loaded DLLs.
for i in process.memory_maps():
    print(i.path)

In either case, there will be a fair amount of sifting through file names and guess work required to find the DLL you don’t have.

On Saturday, May 22, 2021 at 7:28:56 PM UTC+1 [hidden email] wrote:

Have you ever used the venerable Dependency Walker?  It's ancient, but it still works for me on Win 10, although it sometimes takes 5-10 minutes to start up these days.  Since it's just two files (depends.exe and depends.dll, the .chm is just help so you can ignore it), you can easily put it on a USB stick and run it on one of the affected machines.

 

 

On Sat, May 22, 2021 at 7:29 AM <[hidden email]> wrote:

Thanks for your fast response. I’m not using Conda, standard python. Pyinstaller version 4.1.

Is there a way to detect what DLL is missing when no error is printed? Or where should I be comparing the dll’s between working and not working PCs.

Cheers,

 

 

From: [hidden email] <[hidden email]> On Behalf Of bwoodsend
Sent: Saturday, 22 May 2021 3:59 AM
To: PyInstaller <[hidden email]>
Subject: [PyInstaller] Re: Exe Not working on different PCs

 

Running on one PC but not another usually translates as missing a DLL which some PCs have already. Are you using Conda? That's a common culprit. And what's your PyInstaller version?

--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/A-aqJ8JIpdE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/56c995a7-e415-47cc-a6e6-473d499f5138n%40googlegroups.com.

--

You received this message because you are subscribed to the Google Groups "PyInstaller" group.

To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/014501d74e93%24aa4d2320%24fee76960%24%40gmail.com.

--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/A-aqJ8JIpdE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/060c8412-7fc9-4877-9cce-2d42f7b1134en%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/007701d751bf%24a3a60990%24eaf21cb0%24%40gmail.com.