I'm trying to run a jupyter notebook on an apple silicon mac and it's been tons of troubleshooting. The latest problem is: I installed the necessary libraries with pip but the program doesn't recognize them. The same thing was happening with pandas and numpy, which started working after installing anaconda (but no pip). Here's the stacktrace:
ImportError Traceback (most recent call last)
/opt/homebrew/lib/python3.9/site-packages/MySQLdb/__init__.py in <module>
17 from MySQLdb.release import version_info
---> 18 from . import _mysql
19
ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/MySQLdb/_mysql.cpython-39-darwin.so, 2): no suitable image found. Did find:
/opt/homebrew/lib/python3.9/site-packages/MySQLdb/_mysql.cpython-39-darwin.so: mach-o, but wrong architecture
/opt/homebrew/lib/python3.9/site-packages/MySQLdb/_mysql.cpython-39-darwin.so: mach-o, but wrong architecture
During handling of the above exception, another exception occurred:
NameError Traceback (most recent call last)
/var/folders/nq/fmv846f95p519gmbd0fc2nj40000gn/T/ipykernel_915/3639928363.py in <module>
4 import numpy
5 import pandas as pd
----> 6 import MySQLdb
/opt/homebrew/lib/python3.9/site-packages/MySQLdb/__init__.py in <module>
22 raise ImportError(
23 "this is MySQLdb version {}, but _mysql is version {!r}\n_mysql: {!r}".format(
---> 24 version_info, _mysql.version_info, _mysql.__file__
25 )
26 )
NameError: name '_mysql' is not defined
What can be happening? Please help