[Error countermeasures]How to install PyInstaller offline.

01/29/2023

When installing Python libraries, I have to install them offline because they are rejected by the proxy.

I was able to install some libraries, but I got stuck with an error when installing PyInstaller, so I’d like to show you why and how to fix it.

How to install offline

First, I will briefly explain how to do an offline installation.

Normally in Python, you can type “py -m pip install library name" on the command line to automatically download and install the library.

However, if you use pip mainly at work, the proxy may block the communication.

In such cases, offline installation can be a solution.

Download the library (whl or tar.gz file) that you want to install from PyPi, and install it offline.

py -m pip install --no-index --find-links=FolderName LibraryName

You can install offline by adding the two options –no-index (refer to the local directory) and –find-links (refer to the directory) when you pip.

Error when installing PyInstaller

I was able to install some libraries offline, but the PyInstaller installation gave me an error and I was stuck.

<Environment>

OS: Windows 10

Python: 3.9.4

pip: 21.1.1

wheel: 0.36.2

PyInstaller: 4.3

py -m pip install --no-index --find-links=downloads pyinstaller

After saving the library in the downloads folder, I ran the above command and got the following error.

C:\Users\***>py -m pip install –no-index –find-links=downloads pyinstaller Looking in links: downloads Processing c:\users*\downloads\pyinstaller-4.3.tar.gz
Installing build dependencies … error
ERROR: Command errored out with exit status 1:
command: 'D:\ProgramFiles\Python\Python39\python.exe’ 'C:\Users\***\AppData\Local\Temp\pip-standalone-pip-5x74odeq__env_pip__.zip\pip’ install –ignore-installed –no-user –prefix 'C:\Users\***\AppData\Local\Temp\pip-build-env-hg2evgp0\overlay’ –no-warn-script-location –no-binary :none: –only-binary :none: –no-index –find-links downloads — wheel setuptools
cwd: None
Complete output (3 lines):
Looking in links: downloads
ERROR: Could not find a version that satisfies the requirement wheel (from versions: none)
ERROR: No matching distribution found for wheel
——————————————————-
WARNING: Discarding file:///C:/Users//Downloads/pyinstaller-4.3.tar.gz. Command errored out with exit status 1: 'D:\ProgramFiles\Python\Python39\python.exe’ 'C:\Users\***\AppData\Local\Temp\pip-standalone-pip-5x74odeq__env_pip__.zip\pip’ install –ignore-installed –no-user –prefix 'C:\Users\***\AppData\Local\Temp\pip-build-env-hg2evgp0\overlay’ –no-warn-script-location –no-binary :none: –only-binary :none: –no-index –find-links downloads — wheel setuptools Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pyinstaller (from versions: 4.3)
ERROR: No matching distribution found for pyinstaller

error message

The “Could not find a version that satisfies the requirement wheel" error has occurred several times in the past.

This error was caused by the lack of a dependency library for the library I wanted to install, and was resolved by installing the dependency library. The error was resolved by installing the dependency libraries. (The online version automatically installs the dependency libraries)

However, as for PyInstaller, for some reason the above error keeps coming up even after installing the dependent library, wheel.

error handling mechanism

I solved the problem by putting the PyInstaller and wheel files in the same folder and running pip.
(If you put the dependent libraries in the same folder, pip will install them at the same time.)

Could not find a version that satisfies the requirement ***

After installing wheel, you will still get this error, but you can fix it by putting the **** libraries into the same folder one after another.
(The installation can be done once all the dependent libraries are in place.)

When a dependency library error occurs in this way, it can be solved by putting the dependent libraries in the same folder.

Click here to read other Python articles.

Python

Posted by やろまい