Can execute python script on Mac M1 chip (ok on M2)

327 views Asked by At

when i try to execute a python script on Mac M1 chip i have this error. Everthing is ok on M2 chip. Any idea ?

Regards, Fred

python3 main.py
Traceback (most recent call last):
File "/Users/lasupprepa/Downloads/code/main.py", line 3, in <module>
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyQt5/QtCore.abi3.so, 0x0002): Symbol not found: __ZTVNSt3__13pmr25monotonic_buffer_resourceE
Referenced from: <645DDC2C-F655-324A-BE87-40804F3AC471> /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore
Expected in: <3EE92404-8FC3-374B-A598-D5C9A8CD64B5> /usr/lib/libc++.1.dylib
1

There are 1 answers

0
MD Kawsar On

There could be several issues please follow as given:

1.Update PyQt5 or Follow the exact Module version as required 2.Use a Virtual Environment. You can use a venv To make track of the Right Version

python3 -m venv myenv
source myenv/bin/activate

3.Compile PyQt5 from Source.

4.Make sure Xcode has been installing in this Macbook You can install Xcode from the App Store or Using below following:

xcode-select --install