I have been trying to convert one of my OpenCV projects into an executable file using Pyinstaller.
The file is working in my cmd but whenever I try to run it through the .exe I get this error:
Traceback (most recent call last):
File "main.py", line 5, in <module>
File "PyInstallerloaderpyimod02_importers.py", line 419, in exec_module
File "cv2__init__.py", line 181, in <module>
File "cv2__init__.py", line 111, in bootstrap
File "cv2__init__.py", line 109, in load_first_config
ImportError: OpenCV loader: missing configuration file: [‘config.py’]. Check OpenCV installation.
Solutions I already tried:
- Giving the cv2 path before executing the pyinstaller command.
- Downgrading the Python version to the minimum as I’m using Ultralytics as one of the libraries.
- Uninstalling and reinstalling the OpenCV.
- Getting all versions compatible.
- Downloaded the latest version of pyinstaller from GitHub.
pip install https://github.com/pyinstaller/pyinstaller/tarball/develop
I don’t what should I do from here!
Please help me out.
New contributor
Shashank Vyas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.