I am trying to write a very simple automatic email sender app on PyCharm in Python.
I tested that my email authentication works but when I am trying to read an excel file with import pandas as pd, I keep getting this error below.
Does anyone know how to solve it?
I read that it’s because the M2 chip of Mac and it is causing issues.
I used iTerm to let the terminal open with Rosetta and reinstalled pip3 install pandas, but it is still giving me this error.
/usr/local/bin/python3.10 /Users/xinyuyang/Xinyu Yang/Career/CKB/pythonProject/EmailSender.py
Traceback (most recent call last):
File "/Users/xinyuyang/Xinyu Yang/Career/CKB/pythonProject/EmailSender.py", line 3, in <module>
import pandas as pd
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
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 "/usr/local/bin/python3.10"
* The NumPy version is: "1.23.4"
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.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Process finished with exit code 1
Really appreciate if someone can help me with that. I remember I wrote something like this before and I never got any errors on the same computer.
Thanks!
See the details above.