Python Package can't be used in Apple M1

In Apple M1 PlatForm
[LSDEfsError] [ASSERT:DtFrame.cpp.LoadDll.278]

[LSDEfsError] [ASSERT:DtFrame.cpp.IEATTransactionBeginEx.616]

[LSDEfsError] [ASSERT:DtFrame.cpp.ObjcTransactionBeginEx.793]

2021-10-08 16:00:22.637423+0800 PythonKitDemo[43658:153895] Metal API Validation Enabled

2021-10-08 16:00:22.875135+0800 PythonKitDemo[43658:153895] +[MTLIOAccelDevice registerDevices]: Zero Metal services found

PythonKit/Python.swift:682: Fatal error: 'try!' expression unexpectedly raised an error: Python exception:

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:

Troubleshooting ImportError — NumPy v1.22.dev0 Manual

Please note and check the following:

*** The Python version is: Python3.9 from "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"**

*** The NumPy version is: "1.21.1"**

and make sure that they are the versions you expect.

Please carefully study the documentation linked above for further help.

Original error was: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): no suitable image found. Did find:
can you help me? thanks!
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so: mach-o, but wrong architecture

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so: mach-o, but wrong architecture

Traceback:

File "/Users/zhangjw/Library/Developer/Xcode/DerivedData/Python_MacOS-dcpduaameshlekchztfuoramnvja/Build/Products/Debug/PythonKitDemo.app/Contents/Resources/pythonFunction.py", line 1, in

import numpy as np

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/init.py", line 150, in

from . import core

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/init.py", line 48, in

raise ImportError(msg)

2021-10-08 16:00:23.737743+0800 PythonKitDemo[43658:153895] PythonKit/Python.swift:682: Fatal error: 'try!' expression unexpectedly raised an error: Python exception:

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:

Troubleshooting ImportError — NumPy v1.22.dev0 Manual

Please note and check the following:

*** The Python version is: Python3.9 from "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"**

*** The NumPy version is: "1.21.1"**

and make sure that they are the versions you expect.

Please carefully study the documentation linked above for further help.

Original error was: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): no suitable image found. Did find:

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so: mach-o, but wrong architecture

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so: mach-o, but wrong architecture

Traceback:

File "/Users/zhangjw/Library/Developer/Xcode/DerivedData/Python_MacOS-dcpduaameshlekchztfuoramnvja/Build/Products/Debug/PythonKitDemo.app/Contents/Resources/pythonFunction.py", line 1, in

import numpy as np

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/init.py", line 150, in

from . import core

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/init.py", line 48, in

raise ImportError(msg)

Check to make sure you are not running any of it with Rosetta 2.

Terms of Service

Privacy Policy

Cookie Policy