I am trying to install pyautogui package in offline mode i.e. on a machine that does not have internet using the command "py -3.12 -m pip install --no-index -f “pathToDirectorywherePYAUTOGUItarispresent” pyautogui. But I am getting this error for pyscreeze as below
“Processing pyscreeze (from pyautogui)
error :subprocess-exited-with-error
exit code:1
Processing setuptools-75.6.0-py3-none-any-whl
Error: Could not fund a version that satisfies the requirement wheel (from versions:none)
Error : No matching distribution found for wheel”
What is happening is that pip is trying to build pyautogui from source so presumably the file you have in there is an sdist (.tar.gz) rather than a wheel (.whl). In order to build from the sdist it needs to install some other things and it fails to find the wheel package. There are two options:
Download the wheel package which is what pip fails to find and put that in the wheelhouse.
Download a suitable wheel (.whl) file for pyautogui and put that in the wheel house instead of the sdist (.tar.gz).
It is also possible that pyautogui has other runtime dependencies. If so then you need to get files for them and put them in the wheelhouse as well.
The simplest way to do all of this is probably to use pip download on another computer and tell it to download all the wheels for all the packages you need. Then transfer those to the computer that does not have internet. You need to make sure that the OS and Python versions match between the two machines.
Hello, I’m the author of PyAutoGUI. PyAutoGUI also relies on a few other packages (I’ve split the functionality out to multiple pacakges). I’ve copied and pasted the requirements from its setup.py here:
['pyobjc-core;platform_system=="Darwin"',
'pyobjc-framework-quartz;platform_system=="Darwin"',
'python3-Xlib;platform_system=="Linux" and python_version>="3.0"',
'python-xlib;platform_system=="Linux" and python_version<"3.0"',
'pymsgbox',
'pytweening>=1.0.4',
'pyscreeze>=0.1.21',
'pygetwindow>=0.0.5',
'mouseinfo']
I’ll be looking into updating this package to be friendlier for offline downloads, but honestly the easiest fix for this issue is to be online and download everything from PyPI.