gooofy / drawilleplot

matplotlib backend for graph output in unicode terminals using drawille
Apache License 2.0
77 stars 5 forks source link

module 'PIL.Image' has no attribute 'ANTIALIAS' #8

Open MaxFremen opened 4 months ago

MaxFremen commented 4 months ago

when installing from pip:

... code from README.MD ...

In [2]: plt.show()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 plt.show()

File ~/anaconda3/envs/dzm-audio/lib/python3.10/site-packages/matplotlib/pyplot.py:527, in show(*args, **kwargs)
    483 """
    484 Display all open figures.
    485
   (...)
    524 explicitly there.
    525 """
    526 _warn_if_gui_out_of_main_thread()
--> 527 return _get_backend_mod().show(*args, **kwargs)

File ~/anaconda3/envs/dzm-audio/lib/python3.10/site-packages/drawilleplot/__init__.py:30, in show()
     28         canvas = manager.canvas
     29         canvas.draw()
---> 30         string = canvas.to_txt()
     31         print(string)
     32         # display(HTML("<div style=\"font-size:2px; line-height:90%;\"><tt>" + string + "</tt></div>"))
     33 finally:
     34     #if close and Gcf.get_all_fig_managers():
     35     #    matplotlib.pyplot.close('all')

File ~/anaconda3/envs/dzm-audio/lib/python3.10/site-packages/drawilleplot/__init__.py:66, in FigureCanvasDrawill
e.to_txt(self, sep, tw, invert, threshold)
     64 w = tw
     65 h = int(h * ratio)
---> 66 i = i.resize((w, h), Image.ANTIALIAS)
     68 i = i.convert(mode="L")
     70 can = Canvas()

AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

No issues when installing from repo though.

denis-bz commented 1 month ago

Same error with pip 24.1.2 (py 3.10, macos 10.15) look like an old .tar https://files.pythonhosted.org/packages/... (origin.json below) but I don't know how to update it on pypi ?

Downloading drawilleplot-0.1.0-py2.py3-none-any.whl (3.5 kB)
Building wheels for collected packages: drawille
  Building wheel for drawille (setup.py) ... done
  Created wheel for drawille: filename=drawille-0.1.0-py3-none-any.whl size=4706 sha256=fea28d249e8287cd9ac69eeec02ac98fff9f60434f9dd36a1321f83281b6d632
  Stored in directory: /Users/bz/Library/Caches/pip/wheels/e4/6f/45/c18832064027f82aa3e9d47233e47221bd990c01cd2c52d676
Successfully built drawille
Installing collected packages: drawille, drawilleplot
Successfully installed drawille-0.1.0 drawilleplot-0.1.0

.../Caches/pip/wheels/.../origin.json --

{"archive_info": {"hash": "sha256=b789d2f1359b10628789b21b2df659c9c3d0c53884cee27b0d8b1ae93c22fbcb",
"hashes": {"sha256": "b789d2f1359b10628789b21b2df659c9c3d0c53884cee27b0d8b1ae93c22fbcb"}},
"url": "https://files.pythonhosted.org/packages/3b/ea/f17c181b9a514c9336284d7651861432bd0de112b4c82cc73e1127c2a187/drawille-0.1.0.tar.gz"}