Big Sur 上的 2019 Macbook Pro + 最新版 Spyder 上的 Pandas 导入错误
Posted
技术标签:
【中文标题】Big Sur 上的 2019 Macbook Pro + 最新版 Spyder 上的 Pandas 导入错误【英文标题】:Pandas importation error on a 2019 Macbook Pro on Big Sur + newest version of Spyder 【发布时间】:2021-05-25 20:28:39 【问题描述】:我将我的 2019 Macbook Pro 15 英寸更新为 Big Sur。我发现 Spyder + Anaconda 有很大的延迟,Spyder 开发人员建议只需下载 Spyder .dmg 并通过那里使用 python。
但是,每次我尝试使用 pandas(我有多个依赖于包的脚本)时,都会收到此错误:
runcell(0, '/Users/insertname/Documents/projectpath')
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/tslibs/conversion.pyc", line 14, in <module>
File "pandas/_libs/tslibs/conversion.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1116, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/tslibs/conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
ModuleNotFoundError: No module named 'pandas._libs.tslibs.base'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/missing.pyc", line 14, in <module>
File "pandas/_libs/missing.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1116, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missing
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/tslibs/__init__.pyc", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.tslibs.conversion'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/hashtable.pyc", line 14, in <module>
File "pandas/_libs/hashtable.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1116, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtable
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.missing'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/interval.pyc", line 14, in <module>
File "pandas/_libs/interval.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1116, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.hashtable'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/insertname/Documents/projectpath", line 12, in <module>
import pandas
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/__init__.pyc", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/__init__.pyc", line 13, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.interval'
我现在只在脚本中调用import pandas
进行测试。我已经从我的电脑上彻底清除了 Anaconda,并使用 brew install
获取最新版本的 python (3.9.2) 并拥有最新的 Spyder 版本 (4.2.1)。
框架底部的 Spyder 说它正在运行 python 3.9.1 - 虽然我不知道这是否与它有关。我试过pip3
多次卸载pandas并重新安装,清理了我的电脑上的Spyder和python(虽然不是每台Mac自带的python,我相信是2.7)——没有什么能让我摆脱上面的错误。
我不想回到 Anaconda(至少在延迟消失之前)。我已经尝试了 this 问题中的所有内容 - 但我不想采用 anaconda 方式。
【问题讨论】:
【参考方案1】:我花了整整两天的时间试图找到答案。来了——
我不知道为什么python解释器需要一整天才能最终接受输入(我不得不重新指向python包,using the second answer on this guide)。
然后控制台显示了与 Spyder IDE 底部不同的版本(3.9.1 vs 3.9.2)。
然后我不得不使用pip3 install spyder-kernels
- 和繁荣。很好走。 Pandas 错误已修复。
【讨论】:
以上是关于Big Sur 上的 2019 Macbook Pro + 最新版 Spyder 上的 Pandas 导入错误的主要内容,如果未能解决你的问题,请参考以下文章
Macbook将加入Face ID?macOS Big Sur发现证据
Macbook m1 Big Sur 安装php7.1 xdebug 折腾记
在使用 Big Sur 11.4 的 MacBook Pro 中面临权限相关问题
Big Sur 更新 11.3 版后 MacBook Pro 错误 Xampp 不起作用
无法在 M1 MacBook Big Sur 中安装 mysql2 0.5.3
Mac M1 Big Sur 上的错误“dlsym(0x7f8ffd410a90, Init_bigdecimal): symbol not found”