Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install matplotlib does not work under termux (Android)

I installed termux on my Android tablet, and was able to successfully install Python 3.9 and Numpy, but not matplotlib. Apparently the .whl was downloaded and cached, and now when I try to install, whether using pip or pkg it attempts to use the cached .whl file. I tried clearing memory and reinstalling everything from scratch, but it still downloads the same .whl, with the same result. (The termux wiki provided no clues that I could find) Anybody have a work around or fix?

like image 359
24b4Jeff Avatar asked Feb 20 '26 19:02

24b4Jeff


2 Answers

I had the same issue, but the existing answers did not work for me. In my case, it turned out to be an issue with installing Pillow. If "pip install Pillow" does not work, you may have the same issue.

To fix it, follow the image editor installation instructions for Pillow given on the Termux wiki. Look at the Python section of this page: https://wiki.termux.com/wiki/Image_Editors. After that "pip install matplotlib" worked without issue.

like image 173
Anunnaki Avatar answered Feb 23 '26 09:02

Anunnaki


As I did not want to install Ubuntu on the tablet, what I wound up doing was installing Pydroid 3. I was then able to install Numpy and Matplotlib using pip. Thanks for the effort!

like image 30
24b4Jeff Avatar answered Feb 23 '26 08:02

24b4Jeff