A few simple lines of code all have problems, so there must be many problems with the big project
I didn’t even import the numpy module before, and there was a problem. I imported it but it still had problems
import pyautogui,numpy
box = pyautogui.locateOnScreen('q.png')
p = pyautogui.center(box)
pyautogui.click(p.x,p.y+8)
pyinstaller -F nocv.py
PS D:\TOOLS\temp77\dist> D:\TOOLS\temp77\dist\nocv.exe
OpenCV bindings requires "numpy" package.
Install it via command:
pip install numpy
Traceback (most recent call last):
File "numpy\core\__init__.py", line 24, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "numpy\core\multiarray.py", line 10, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "numpy\core\overrides.py", line 8, in <module>
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "numpy\__init__.py", line 144, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "numpy\__config__.py", line 4, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "numpy\core\__init__.py", line 50, in <module>
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.10 from "D:\TOOLS\temp77\dist\nocv.exe"
* The NumPy version is: "1.26.4"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "nocv.py", line 1, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "numpy\__init__.py", line 149, in <module>
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
[22244] Failed to execute script 'nocv' due to unhandled exception!