I need to install PyInstaller offline. I already have setuptools but it is trying to download it anyway. What am I doing wrong? If it is because of --ignore-installed in the pip command, how do I turn that off?
C:\Users\[user]\Desktop\software\pybaries3>pip install C:\Users\[user]\Desktop\software\pybaries3\PyInstaller-3.6
Processing c:\users\[user]\desktop\software\pybaries3\pyinstaller-3.6 Installing build dependencies ... error Complete output from command c:\users\[user]\appdata\local\programs\python\python36-32\python.exe -m pip install --ignore-installed --no-user --prefix C:\Users\[user]\AppData\Local\Temp\pip-build-env-2m5pzlvw --no-warn-script-location --no-binary :none: --only-binary :none: -i -- setuptools>=38.2.5 wheel: Collecting setuptools>=38.2.5 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x02F69A10>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/setuptools/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x02F69AD0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/setuptools/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x02F69A90>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/setuptools/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x02F69B10>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/setuptools/ Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x02F69BD0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/setuptools/ Could not find a version that satisfies the requirement setuptools>=38.2.5 (from versions: ) No matching distribution found for setuptools>=38.2.5 ----------------------------------------
Command "c:\users\[user]\appdata\local\programs\python\python36-32\python.exe -m pip install --ignore-installed --no-user --prefix C:\Users\[user]\AppData\Local\Temp\pip-build-env-2m5pzlvw --no-warn-script-location --no-binary :none: --only-binary :none: -i -- setuptools>=38.2.5 wheel" failed with error code 1 in None
C:\Users\[user]\Desktop\software\pybaries3>pip list
Package Version
-------------- -------
pip 18.1
pywin32-ctypes 0.2.0
setuptools 40.6.2
C:\Users\[user]\Desktop\software\pybaries3> 0 2 Answers
I need to install PyInstaller offline.
Prerequisites
Download a copy of all the relevant modules needed to install PyInstaller. pip typically contacts the Python Package Index (PyPI) to gather these files, but you can collect them manually yourself. These include:
PyInstaller (
.tar.gz)setuptools (
.whl)pywin32-ctypes (
.whl)future (
.tar.gz)altgraph (
.whl)pefile (
.tar.gz)
In your case, you may be able to skip PyInstaller, setuptools and pywin32-ctypes but you will likely still need copies of at least future, altgraph and pefile. Also be aware that though your version of setuptools will probably work, it is not up-to-date.
If you do not wish to download the necessary files above individually from their respective PyPI pages (linked), you can simply use ex.:
pip download pyinstallerfrom a PC with pip and the ability to connect to PyPI, in order to save PyInstaller and its dependencies locally. You can then transfer these files to your offline machine as you see fit.
Note that while it's generally best to download modules using a copy of pip associated with the same version of Python as used e.g. on your offline machine, in this instance it should matter less (so long as you aren't using Python 2), as the specific files above should all currently be compatible with most versions of Python 3.
Installation
On the offline machine, place all the files you downloaded above into the same folder ex.:
C:\Users\[user]\Desktop\software\pybaries3Then run pip with the --no-use-pep517, --no-index and --find-links options ex.:
pip install --no-use-pep517 --no-index --find-links C:\Users\[user]\Desktop\software\pybaries3 C:\Users\[user]\Desktop\software\pybaries3\PyInstaller-3.6.tar.gzDon't forget to include to the e.g. tar.gz file extension for PyInstaller (so use ex.PyInstaller-3.6.tar.gz, not just PyInstaller-3.6).
You can read more about these pip install options and more generally about PEP 517 at the respective links given, but as a quick summary:
--no-use-pep517 bypasses an issue with pip and PyInstaller where modules in the current working directory fail to install.
--no-index ensure that only the location specified by --find-links is used to install modules (so in this case, just e.g.
C:\Users\[user]\Desktop\software\pybaries3, not any online sources like PyPI).
Use --no-build-isolation to prevent pip from inserting ---ignore-installed. The install still fails if you're missing any dependencies. See @anaksunaman's answer if you need help getting packages for offline use.