名称“\u mysql”未使用jupyter笔记本在m1 mac上定义

rlcwz9us  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(233)

我试着在苹果的硅mac上运行一台jupyter笔记本电脑,这是一大堆的疑难解答。最新的问题是:我用pip安装了必要的库,但程序无法识别它们。同样的事情也发生在Pandas和numpy身上,它们在安装anaconda(但没有pip)后开始工作。这是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

会发生什么?请帮忙

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题