Skip to content

Latest commit

 

History

History
150 lines (122 loc) · 5.9 KB

README.en.md

File metadata and controls

150 lines (122 loc) · 5.9 KB

[TermuxPy] (1.2.3) Python 3 for Termux

Version (1.2.3) - Modification date: 17/APR/2019
GitHub license Donate
Python3 + Numpy + Scipy + Matplotlib for Termux.
An automated script to install Python 3 and scientific libraries for Termux (Android)

Read in other languages: Spanish, English

Alt text

Table of Contents

Version notes

Versión (1.2.3) - Modification date: 17/ABR/2019
Support for terminals that by default have the environment variable LD_LIBRARY_PATH blank and can not be installed correctly numpy, scipy and matplotlib.

Versión (1.2.2) - Modification date: 17/ABR/2019
Support for new version of termux, addition of library "zlib-dev" for correct compilation of matplotlib

Version (1.2.1) - Modification date: 16/MAR/2019
The modification was added to run the latest version of matplotlib (3.0.3)
Major improvement!:
The matplotlib 3.0.3 version will automatically detect the backend "Agg", this is explained as follows,:

Old import:

import matplotlib
matplotlib.use ("Agg")
import matplotlib.pyplot as a plot

The previous code can be simplified by (giving the same result):

import matplotlib.pyplot as a plot

Important : This did NOT provide graphics availability by using plot.show() , to save the graphics it is recommended to use plot.savefig(file_name).

Version (1.2.0) - Modification date: 18/NOV/2018
Modification was added to run the latest version of matplotlib (3.0.2)

Pre requirements

It is necessary to have approximately 380 MB of free space for a correct installation (the size may vary for later updates).

Write permissions activated

Have the Termux write permissions enabled (Settings => Apps => Termux => Permissions => Storage)
Activar permisos en Termux Activar permisos en Termux Activar permisos en Termux

Install Git

Install Git in Termux:

1) Install Git:

Execute the following command in termux:

pkg install git

pkg install git

2) Accept the installation of Git:

Aceptamos instalación

3) Wait until the installation finishes:

Instalación terminada

Installation

1) Get TermuxPy

Execute the following command in termux:

git clone https://github.com/NatanVilchis/termuxpy

Instalación de TermuxPy
Wait until get the entire repository:
Instalación de TermuxPy

2) Open folder termuxpy

Execute the following command in termux:

cd termuxpy

Instalación de TermuxPy

3) Run termuxpy.sh

Execute the following command in termux:

bash termuxpy.sh

It's important that while the installation is in process the device will not sleep because it can generate a corrupted installation

Instalación de TermuxPy
Wait until the installation is finished: Instalación de TermuxPy

Note (for some devices):
It's possible that some devices don't have the environment variable LD_LIBRARY_PATH assigned correctly, in this case, the following message will be displayed:
Mensaje de LD_LIBRARY_PATH
To continue with the installation go to the folder where "termuxpy" was downloaded and execute the command again:

bash termuxpy.sh

The installation will now end without problems.

Example

This repository has an example to generate a graph using the matplotlib library

1) Go to the example folder

cd ejemplo

Ejemplo

2) Run example with Python

Execute the following command in termux:

python normal_pdf.py

Ejemplo

The example will be executed showing the graphic when you press the enter key
Ejemplo
Generated graphic:

Ejemplo

3) Graphic image file

The generated graphic will be automatically saved with name "normal_pdf.jpg"
Ejemplo

Made by

Natan Vilchis
Repository used to help this script: its-pointless-gcc_termux

License

This project is licensed under the MIT license, see LICENSE to see the details.