qpython-android / qpython

QPython is an Android Python engine primarily designed for Python and AI learners. It offers a range of impressive features to enhance Python programming experience.
https://www.qpython.org
1.05k stars 193 forks source link

Uninstall pip to replace with new version #209

Closed BhJaipal closed 1 year ago

BhJaipal commented 1 year ago

The older pip and python version does not support libraries like matplotlib. So, I think if I uninstall pip and download and extract new pip file in site-packages. I can install libraries like matplotlib too. And I was completely aware that what could happen. And it happened as I expected, I can't use pip commands now 😅 But I can still download and extract in site-packages.

BhJaipal commented 1 year ago

I have found it's solution first open terminal then

cd data/user/0/org.qpython.qpy3/files/bin
rmdir pip 
ls

python3-android5 is used for execution of python files in Qpython 3L. Now, install pip

python3-android5 -m pip install pip
python3-android5 -m pip show pip

It will install pip-21.3.1

From any other python app like I used Pydroid3, open terminal and execute these

cd ..
cd files/arm-linux-androideabi/bin
# use ls and search pip and if you find it in list, do this
ls
cp /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/bin/pip /storage/emulated/0/pip
# We cannot copy it to qpython private space by Pydroid3 Terminal

If you use termux, use this

cp /data/data/com.termux/files/usr/bin/pip /storage/emulated/0/pip

Now, open Qpython Terminal, you either use

import os
os.system("sh")

Or

import setuptools
setuptools.setup()

It will do same, or execute a file containing error it open terminal too in qpython

cp /storage/emulated/0/pip /data/user/0/org.qpython.qpy3/files/bin/pip
# this pip file is a Python file without extension like python3-android5