1

I have a Python.exe file that I created using Pyinstaller. It runs fine when I execute it on my own PC, but if I move it to another PC on the network, it gives the error pop up message "Fatal error detected, Failed to execute script __".

I am needing to run this Python exe on any computer on the network even if they don't have Python installed.

I used the code below and it packages everything into one single .exe file in the dist folder.

pyinstaller -F -w script.py

I am needing to run this Python.exe on any computer on the network even if they don't have Python installed. Is this possible?

1
  • 2
    It is possible. That is the whole purpose of pyinstaller. But it is clear that you are not bundling everything that your application needs into the .exe. Look at pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html to discover what the problem might be. This may be a longer process than you might like. Commented May 17, 2019 at 13:13

2 Answers 2

1

Please notice that pyinstaller is tailored to the specific OS it was created in (it is especially dependent on C implementation, app created by PyInstaller on, say, ubuntu with glibc will be incompatible with alpine running musl). What's more, it is not standalone executable per se, it has Python interpreter bundled inside.

You can find some more info in pyinstaller docs.

Easiest workaround I have found is to use Docker and create your app with multistage build.

If that's not an option, you may have to use Cython or other approach.

Sign up to request clarification or add additional context in comments.

Comments

0

I was able to find out the solution to this problem.

I re-ran pyinstaller without -w and saw the error message in cmd "InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified."

My script used pyodbc and I was researching around and saw to change the driver to "Driver={SQL Server};". I originally had it as "Driver={SQL Server Native Client 11.0};", so once I changed this to just SQL Server, the executable files ran fine on other machines.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.