0

On Jupyter notebook, running Python 3 code. Trying to build a squarify Tree map.

When I run the code:

import squarify as sq

ModuleNotFoundError arrises. "No Module named 'squarify'."

Although I know there such a module.

Can someone help me?

I've tried to put

path/to/python -m pip install squarify

and

install squarify

in the cell, but to no avail.

import squarify as sq results in:

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'
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Zach
  • 11
  • 1
  • 2
  • This may help: https://stackoverflow.com/questions/38368318/installing-a-pip-package-from-within-a-jupyter-notebook-not-working – benvc Sep 26 '19 at 18:14

3 Answers3

0

Thank you for all the answers to this question. I have since figured it out. Best advice I can give is to search Anaconda Prompt (Anaconda 3) on your computer, which will pull up a script. Then simply time pip install squarify.

Once this loads the program on your computer, try to import squarify as sq on your jupyter notebook, and the chunk should now work without errors.

Good luck to everyone, and thank you for all the help!

Zach

Zach
  • 11
  • 1
  • 2
0

In my case squarify was added to miniconda - I was not able to import it into anaconda. I opened Anaconda Navigator - uninstalled miniconda. Updated anaconda and imported squarify to anaconda (anaconda prompt) and it work now via simple import squarify cmd.

HankerPL
  • 21
  • 4
0

For me I opened Anaconda Navigator, went to Environments base(root) and clicked Open Terminal. I run the below command in the terminal and all was OK.

pip install squarify
sammy ongaya
  • 1,313
  • 1
  • 15
  • 14