Hi gsaloma ,
Copying from gpt4:
The error you encountered seems to be related to a missing or improperly installed library on your system. The error message suggests that the CoreFoundation framework is either missing or not loaded properly. To resolve this issue, you can try the following solutions:
Reinstall OpenCV:
Uninstall the current OpenCV version and reinstall it using the following commands:
pip uninstall opencv-python opencv-python-headless
pip install opencv-python opencv-python-headless
Update your system:
Updating your operating system can sometimes resolve issues related to missing or improperly installed libraries. On macOS, you can update your system through the System Preferences app or by running the following command in the terminal:
softwareupdate --install --all
After updating your system, restart your computer and try running the script again.
Check if CoreFoundation framework is present:
Navigate to /System/Library/Frameworks/CoreFoundation.framework/Versions/A/ on your system and verify if the CoreFoundation framework is present. If it's missing, you might need to reinstall macOS to resolve the issue.
If the problem persists, you can try using a different Python environment by creating a new virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install opencv-python opencv-python-headless numpy
Then, run your script within the virtual environment.
If none of the solutions above resolve the issue, please provide more information about your system, such as the operating system version and Python version, so I can further assist you.