Error encountered when using hclust2.py in the conda-created metaphlan4.2.2 environment on Ubuntu 22 terminal

In the Ubuntu 22 terminal, within the conda-created metaphlan4.2.2 environment, I encountered an error when using hclust2.py with the following code. How can I resolve this issue?

Here is my code:

hclust2.py -i sample_barplot/taxonomy.txt -o sample_barplot/heatmap_with_groups.pdf–metadata merged_metadata.txt–s_dist_f braycurtis–f_dist_f correlation–linkage average–metadata_rows 2,3,4,5–top 50

The error prompt is as follows:

Traceback (most recent call last):

File “/home/wrjdy/miniconda3/envs/metaphlan4.2.2/bin/hclust2.py”, line 825, in

hclust2_main()

~~~~~~~~~~~~^^

File “/home/wrjdy/miniconda3/envs/metaphlan4.2.2/bin/hclust2.py”, line 779, in hclust2_main

read = ReadCmd( )

File “/home/wrjdy/miniconda3/envs/metaphlan4.2.2/bin/hclust2.py”, line 768, in init

Heatmap.input_parameters( p )

~~~~~~~~~~~~~~~~~~~~~~~~^^^^^

File “/home/wrjdy/miniconda3/envs/metaphlan4.2.2/bin/hclust2.py”, line 518, in input_parameters

pylab.register_cmap(name=n,cmap=my_cmap)

^^^^^^^^^^^^^^^^^^^

AttributeError: module ‘pylab’ has no attribute ‘register_cmap’

Here is my appendix
hclust2.txt (35.9 KB)