ModuleNotFoundError installing yellowbrick in Python

Question:

I am having trouble installing yellowbrick.

I am using Anaconda, hence I took advantage of using the “conda install”.

# set number of clusters
kclusters = 5

pittsburgh_grouped_clustering = pittsburgh_grouped.drop('Neighborhood', 1)

X = pittsburgh_grouped.drop('Neighborhood', 1)

from sklearn.cluster import KMeans
!conda install -c districtdatalabs yellowbrick
from yellowbrick.cluster import KElbowVisualizer

# instantiate the model and visualizer
model = KMeans()
visualizer = KElbowVisualizer(model, k=(1,10))

visualizer.fit(X) # fit data to visualizer
visualizer.poof() # draw/show/poof the data

I expect the package to be installed. The error message I am receiving is:

ModuleNotFoundError: No module named ‘yellowbrick’.

What am I missing?

Asked By: Mo Kaiser

||

Answers:

First install yellowbrick outside of your code and verify that it actually installed. You can do this through the terminal doing exactly what you say. You may need to upgrade/downgrade your libraries which may not be happening when you install in your script.

Then try and run your script without the !conda install -c districtdatalabs yellowbrick because once its installed you don’t have to install it again.

Answered By: BenT

Steps to follow:

  1. Open Anaconda Navigator
  2. Environments
  3. Open Terminal
  4. Copy-paste "pip install yellowbrick"
Answered By: Baran

My experienced the same thing but I tried and it worked by using the following steps :

  1. Open search on your windows
  2. Look for anaconda prompt, and click
  3. conda install -c districtdatalabs yellowbrick (use the following script to install the yellowbrick module)
    enter image description here

Where do I get the script from? Here I attach the link: https://anaconda.org/DistrictDataLabs/yellowbrick

Answered By: Ravi Rahmatul Fajri
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.