我跟随https://www.firstpythonnotebook.org/(我是Jupyter的初学者,通常使用python、pip等)。到目前为止,我遵循的基本步骤是:
pipenv install jupyterlab
pipenv install pandas
(on this page)但是,当打开我的第一个笔记本并运行import pandas
时,我收到一个错误,它似乎来自将numpy
作为pandas
的依赖项导入
import pandas
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-1-38d4b0363d82> in <module>
----> 1 import pandas
~/.local/share/virtualenvs/test-notebook-again-duPr9W-R/lib/python3.9/site-packages/pandas/__init__.py in <module>
9 for dependency in hard_dependencies:
10 try:
---> 11 __import__(dependency)
12 except ImportError as e:
13 missing_dependencies.append(f"{dependency}: {e}")
~/.local/share/virtualenvs/test-notebook-again-duPr9W-R/lib/python3.9/site-packages/numpy/__init__.py in <module>
284 "that provided NumPy.\n{}\n".format(
285 error_message))
--> 286 raise RuntimeError(msg)
287 del _mac_os_check
288
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned
我相信,在安装pandas时,默认情况下会在环境中安装Numpy,但这种安装似乎出了问题?我不知道什么是“加速”或“Polyfit”,老实说,试着去读它们让我觉得我有点不知所措。这里一定有一个简单的解决方案,而不是作为一个完全的初学者去理解这些东西,对吗?有人知道为什么会这样吗
也出现相同错误,已尝试pipenv安装matplotlib。使用Python3.9
托马斯在评论中的链接是正确的。我从2020年7月20日开始将Python回滚到早期版本,即Python 3.8.5,并且我能够使用
pip3 install pandas
然后pip3 install notebook
最后import pandas, numpy
将pandas安装到Jupyter中在我的Mac电脑上很有魅力
https://gist.github.com/yatsu/47bdde35e8abbe7d14bbe730342aa9e0
使用Python 3.9.0的Numpy 1.19.2
相关问题 更多 >
编程相关推荐