找不到模块错误:没有名为“ squarify”的模块

时间:2019-09-26 17:36:47

标签: python-3.x

在Jupyter笔记本上,运行Python 3代码。试图构建一个方形树图。

当我运行代码时:

import squarify as sq

  

ModuleNotFoundError到达。 “没有名为“ squarify”的模块。”

虽然我知道有这样的模块。

有人可以帮我吗?

我试图放

path/to/python -m pip install squarify

install squarify

在该单元格中,但无济于事。

import squarify as sq导致:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-43-d5603c2d6e58> in <module>
      6     #Put a title on the chart
      7 
----> 8 import squarify as sq
      9 
     10 #determine count for each type weathersit

ModuleNotFoundError: No module named 'squarify'

2 个答案:

答案 0 :(得分:0)

感谢您对这个问题的所有回答。从那以后我就知道了。我能提供的最佳建议是在计算机上搜索Anaconda Prompt(Anaconda 3),这将拉出一个脚本。然后只需时间点安装squarify。

一旦这将程序加载到您的计算机上,请尝试将squarify作为sq导入到jupyter笔记本上,并且该块现在应该可以正常工作而不会出现错误。

祝大家好运,谢谢大家的帮助!

扎克

答案 1 :(得分:0)

在我的情况下,将squarify添加到了miniconda中-我无法将其导入到anaconda中。 我打开了Anaconda Navigator-卸载了miniconda。 更新了anaconda并将squarify导入到anaconda(anaconda提示),现在可以通过简单的导入squarify cmd进行工作。

相关问题