ModuleNotFoundError: No module named 'matplotlib_venn'

Hi all,

I am using JupyterLab with Python 3.9 as the kernel.

I am trying this code:

# Import the library
import matplotlib.pyplot as plt
from matplotlib_venn import venn3
 
# Custom text labels: change the label of group A
v=venn3(subsets = (10, 8, 22, 6,9,4,2), set_labels = ('Group A', 'Group B', 'Group C'))
v.get_label_by_id('A').set_text('My Favourite group!')
plt.show()

But it returns an error:
ModuleNotFoundError: No module named ‘matplotlib_venn’

Then I go to terminal and activate my conda to type:

conda install matplotlib_venn

It returns this:

PackagesNotFoundError: The following packages are not available from current channels:

  - matplotlib_venn

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org


What should I do?

I want to plot venn diagram.

Thanks…

You can install it from conda-forge:

conda install -c conda-forge matplotlib-venn

Or from pypi:

pip install matplotlib-venn
1 Like

Thanks it works