为了账号安全,请及时绑定邮箱和手机立即绑定

无法在 Jupyter 笔记本中导入 Numpy

无法在 Jupyter 笔记本中导入 Numpy

炎炎设计 2023-10-11 16:01:10
目前为止我所遵循的步骤基本上是:安装pipenv,在所需目录中创建新环境pipenv install jupyterlabpipenv install pandas但是,当打开我的第一个笔记本并运行 时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 默认安装在环境中,但这个安装似乎出了问题?我不知道&ldquo;Accelerate&rdquo;或&ldquo;Polyfit&rdquo;是什么,说实话,尝试阅读它们的内容感觉就像我无法理解。这里一定有一个比作为一个完全初学者尝试理解这些事情更简单的解决方案,对吧?有人知道为什么会发生这种情况吗?
查看完整描述

3 回答

?
芜湖不芜

TA贡献1796条经验 获得超7个赞

在我的 Mac 上运行得非常顺利。

https://gist.github.com/yatsu/47bdde35e8abbe7d14bbe730342aa9e0

Numpy 1.19.2 与 Python 3.9.0


查看完整回答
反对 回复 2023-10-11
?
温温酱

TA贡献1752条经验 获得超4个赞

也遇到了同样的错误,尝试使用pipenv install matplotlib。使用Python 3.9。



查看完整回答
反对 回复 2023-10-11
?
慕工程0101907

TA贡献1887条经验 获得超5个赞

将 Python 回滚到较早的版本,即 2020 年 7 月 20 日的 Python 3.8.5,并且我能够使用然后最后安装pip3 install pandaspip3 install notebookJupyterimport pandas, numpy中。



查看完整回答
反对 回复 2023-10-11
  • 3 回答
  • 0 关注
  • 128 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信