pyplati / platipy

Processing Library and Analysis Toolkit for Medical Imaging in Python
https://pyplati.github.io/platipy/
Apache License 2.0
111 stars 27 forks source link

Matplotlib import error (matplotlib's version) #157

Closed denbonte closed 1 year ago

denbonte commented 2 years ago

Dear Platipy Devs,

Good day, and thank you so much for the time you put in the development of the toolkit!

I just wanted to point out that right now, installing PlatiPy from both pip:

pip install platipy

and from the GitHub repo:

pip install git+https://github.com/pyplati/platipy.git

and trying to run the pipelines (it's really just the import) in some environments (e.g., Google Colab, for instance in the tutorial you provided here) throws the following error:

---> 12 from platipy.imaging.tests.data import get_lung_nifti

[/usr/local/lib/python3.7/dist-packages/mpl_toolkits/axes_grid1/axes_grid.py](https://localhost:8080/#) in <module>
     49 
     50 
---> 51 _cbaraxes_class_factory = cbook._make_class_factory(CbarAxesBase, "Cbar{}")
     52 
     53 

AttributeError: module 'matplotlib.cbook' has no attribute '_make_class_factory'

Ignore the from platipy.imaging.tests.data import get_lung_nifti as it happens no matter what submodule one imports from imaging:

image


Installing matplotlib==2.1.1 (or newer versions, but not 3.x.x as far as I tried) solves it - provided it's executed in different cells (in Colab Notebooks).

image

I hope opening this issue can help in some way broadening support (it sounds like a very small problem to solve anyways!)!

pchlap commented 2 years ago

Hi @denbonte,

thanks a lot for creating this issue. We are currently working on migrating platipy's package management to use poetry. I hope that this helps us resolve issues like this.

It's currently a work in progress, but if you'd like to give that development branch a try, you could try installing platipy in your environment using this command:

pip install git+https://github.com/pyplati/platipy.git@poetry-migrate

Let me know how it goes. I've got a few more things to solve before rolling that branch out but it should be ready soon.

Thanks Phil

pchlap commented 1 year ago

Hi @denbonte, platipy 0.5.0 has been released with dependencies now managed using poetry. I believe this issue is now resolved. Thanks very much for the bug report and please let us know if you notice any further issues.