0

i was trying to generate clusters with dataviz got error

ModuleNotFoundError: No module named 'dataviz'

from dataviz import generate_clusters

i tried !pip install dataviz got info Requirement already satisfied but error still shows

Nick
  • 3,454
  • 6
  • 33
  • 56

1 Answers1

1

It's probably a difference in python environment between your script environment, and pip's environment.

To learn more about your environment, you can run:

>>> import sys
>>> sys.executable
'/usr/bin/python'
>>> sys.version
'2.7.12 (default, Oct  8 2019, 14:14:10) \n[GCC 5.4.0 20160609]'
>>> sys.path
['/usr/lib/python2.7',
 ...
]

from a python prompt, if you can bring one up.

I've often found that

python -m pip install <packagename>

is more reliable than

pip install <packagename>

But that only works if you're executing your script at a shell level, without some other python environment being put in front.

You could also try Installing python module within code

FraggaMuffin
  • 3,915
  • 3
  • 22
  • 26