Fix PyInstaller UPX is not available Error – PyInstaller Tutorial

By | April 15, 2021

We often use pyinstaller to convert python script to exe. Here is a tutorial:

Bundle a Python Application to an EXE with PyInstaller: A Beginner Guide – Python Tutorial

However, we may get UPX is not available error. In this tutorial, we will introduce you how to fix it.

UPX is not available

When we use pyinstaller to bundle python, we may get it. Here is an example:

Fix Pyinstaller UPX is not available

How to fix this error?

UPX is not available, which means pyinstaller can not find upx.exe to encrypt exe file. In order to fix it, we should download upx.

You can download upx.exe here.

https://github.com/upx/upx/releases/

As to us, we are using win 10. We download upx-3.96-win64.zip.

upx for windows 10

Then, we will paste upx.exe to disk F:\

You can add –upx-dir f:\ to fix this error. Here is the result:

For example:

pyinstaller main.py --key 123456 -n test -F -w --upx-dir f:\

pyinstaller UPX is available

Nocie

  • f:\ is the directory where upx.exe is in.
  • You can not use f:\upx.exe, but f:\.

Leave a Reply

Your email address will not be published. Required fields are marked *