Ошибка при установке питона на термукс

I am installing python on termux but I am getting this error:

$ pkg install python
Checking availability of current mirror: ok
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package python

Gino Mempin's user avatar

Gino Mempin

24.6k28 gold badges92 silver badges128 bronze badges

asked Dec 9, 2020 at 4:30

Binson Thangjam's user avatar

0

I think you haven’t update repo, look like you have just install termux. Anyway, execute

apt update

and then install any package.

wjandrea's user avatar

wjandrea

27.2k9 gold badges59 silver badges80 bronze badges

answered Dec 11, 2020 at 11:04

Krishna Kanhaiya's user avatar

1

The following combination of answers from this post worked for me:

  1. termux-setup-storage
  2. termux-change-repo (I selected Albatros)
  3. pkg update and pkg upgrade
  4. exit and then restart termux
  5. pkg install python -y

Andreas Violaris's user avatar

answered Feb 13, 2022 at 2:32

Sergio Cisternas's user avatar

termux has haulted all update through google playstore download it from f-droid
then change mirror it works (sometime)

termux-change-repo

or change it manually by editing

sources.list

file in directory

$PREFIX/etc/apt

check out my blog post for more link

answered Jun 24, 2021 at 4:39

Th3cr00k3dm4n's user avatar

0

Make sure you have an internet connection, then allow access to your storage;

Run termux-setup-storage, this should ask you for permission to allow termux use your device storage.

Then to confirm storage is accessible, run ls ~/storage/shared to list directories contained in shared storage.

If this doesn’t work, try switching repos as some other answers suggest, as the node you’re on may be down.

answered Jul 9, 2021 at 19:37

ruzor's user avatar

ruzorruzor

313 bronze badges

2

Try to upgrade your Termux via pkg upgrade then it finds the packages on pkg

answered Oct 9, 2021 at 16:24

Berke Şentürk's user avatar

Only for mobile termux

termux-change-repo

There might be services for game and science need to select all the 3 options and select the A1batross’s options there by completes all the permission process steps

Once done with all this steps you can install and do operation as Linux terminal

Ps: update the apt would be better before any other steps

answered Jun 15, 2022 at 12:35

renish p.r's user avatar

renish p.rrenish p.r

1051 silver badge5 bronze badges

I changed my termux repository to A1batross’s

answered Jul 15, 2021 at 16:21

Silver's user avatar

Just give storage permission and restart the app, it worked fine for me.

answered Mar 9, 2021 at 18:08

Satwik's user avatar

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Closed

allkhor opened this issue

Jul 27, 2017

· 91 comments

Closed

Can’t install python 3.6.2

#1166

allkhor opened this issue

Jul 27, 2017

· 91 comments

Comments

@allkhor

After update python to version 3.6.2 i can’t install it.
Termux freezes after line Setting up pip…
Tried reinstall termux, and install on another identical phone, python 3.6.2 is not installed.
Python 2 has installed correct.
Device: Meizu m2 mini, android 5.1

uname -a
Linux localhost 3.10.65+ #1 SMP PREEMPT Thu Oct 27 17:21:56 CST 2016 aarch64 Android

Where i can find any log to related problem?
screen

@allkhor

I tried comment out ../usr/var/lib/dpkg/info/python.postinst
The problem with python itself. It doesn’t start. No error message.
How to determine a problem?

@its-pointless

5.1 has some weird bugs. Like for instance a small charcter input per line.

@allkhor

After this commit d3e5452 python not work… Any ideas?


A temporary solution for me: git checkout 9eca797 and sync /packages/python/ to master.
After this i compile and manual install python 3.6.2.

@ghost

s70731-090104
I’ve also same problem 😥😰
python 3.6.2 installation issue #1184

@ghost

Help me please how can i install python 3.6.2????

@its-pointless

@allkhor

Not install: package architecture (arm) does not match system (aarch64).

@ghost

where i move this .deb file?and how to do this?

@ghost

s70801-010822

@ghost

solve this issue, anyone is here?????

@its-pointless

What arch are you using?
arm, aarch64, i686 or x86-64
I will assume aarch64?

@ghost

Meizu m2 — 64bit and also aarch64

@ghost

@ghost

@ghost

Or my phone lag/hang after dpkg…

@ghost

please solve this python issue, 2week before my python 3.6.2 working well but after I’ve uninstall termux and re-install it. Then i install python….so I’m getting this issue…..😅😢😥😥😥😥

@allkhor

Try this: https://github.com/allkhor/t-python/raw/master/python_3.6.2_aarch64.deb
Tested on a meizu m2 mini.
Install on clean termux:

  1. apt update && apt upgrade -y
  2. move deb on your phone.
  3. apt install /path/to/python.deb (/storage/sdcard1/termux-pkgs/python_3.6.2_aarch64.deb)
  4. echo «python hold» | dpkg —set-selections (optional hold to freeze package version)

@ghost

s70801-143752

@ghost

Thank you so much..😃😃😃

@allkhor

You are welcome!
Issue still open, because as i say before, after switched to building with unified headers, python 3.6.2 not install on meizu m2(android 5.1).

@ghost

Don’t close Issue, untill this unified headers not fix in meizu m2..

@allkhor

Because Termux is not a particular linux distros like a debian or a fedora. Termux is a a terminal emulator and Linux environment. You can ask a people’s for help on a gitter or a irc. Please don’t spam this issue, you can delete your comments not relevant to this problem, thanks 8)

@SDRausty

This comment was marked as spam.

@allkhor

@SDRausty

This comment was marked as spam.

@allkhor

@SDRausty Hello! How rooting my phone will help to solved this issue? To root my phone Meizu provide settings in two click to achieve this. I have second phone with a root and python not install on it.
Maybe it’s Meizu specific bug, or android 5.1 x64arch.
I tested on Asus pad with android 5.0 x86 and python install correct.

@SDRausty

This comment was marked as spam.

@ghost

@bmvaghera Sorry, but fixing someone’s source file is out of our scope…

@ckyned

Hi guys, after using this #ln -sf $PREFIX/lib/libandroid-support.so $PREFIX/lib/libintl.so

python3.6.2 is good to go. Any fix on pip?

@ghost

Any fix on pip?

@ckyned You don’t have pip ? Try python -m ensurepip.

@ckyned

@xeffyr
$ python -m ensurepip
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.1 setuptools-28.8.0
$ pip
No command ‘pip’ found, did you mean:
Command ‘php’ from package ‘php’
Command ‘zip’ from package ‘zip’
Command ‘ip’ from package ‘termux-tools’

@ghost

@ckyned Post output of

— pip command may have different ending like pip3, pip3.6, pip3.7 or similar.

And try python -m ensurepip --upgrade --default-pip

@ckyned

@xeffyr $ ls $PREFIX/bin/pip*
/data/data/com.termux/files/usr/bin/pip
/data/data/com.termux/files/usr/bin/pip2
/data/data/com.termux/files/usr/bin/pip2.7
/data/data/com.termux/files/usr/bin/pip3
/data/data/com.termux/files/usr/bin/pip3.6
/data/data/com.termux/files/usr/bin/pip3.7
$ pip
Traceback (most recent call last):
File «/data/data/com.termux/files/usr/bin/pip», line 7, in
from pip._internal import main
ModuleNotFoundError: No module named ‘pip._internal’

@ghost

Have you tried pip3.6 or it throws same error ?

@ckyned

pip3.6 install -r requirements.txt
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting rsa (from -r requirements.txt (line 1))
Could not fetch URL https://pypi.python.org/simple/rsa/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. — skipping
Could not find a version that satisfies the requirement rsa (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for rsa (from -r requirements.txt (line 1))

@ghost

@ckyned This python 3.6.2 is broken after openssl update to v1.1.1. Unfortunately, there no solution for SSL errors other than recompiling.

@Grimler91

So the original issue was about python3 not installing on meizu m2 mini. It seems the workaround for this particular device was to run ln -sf $PREFIX/lib/libandroid-support.so $PREFIX/lib/libintl.so (credits to @Hax4us).
I’m closing this as a workaround has been found.

@nicoabdilqanniy

@nicoabdilqanniy

i can’t install python 3.7.1

@nicoabdilqanniy

@pacoyang

This may be a specific problem on Meizu Flyme system base on Android 5, cause the bionic libc on that system is lost some functions like getrandom. If you still want to install python3 on that system, download the deb python_3.6.2_aarch64.zip which Hax4us had post it on this issue, install it and run that command ln -sf $PREFIX/lib/libandroid-support.so $PREFIX/lib/libintl.so, it may be work.

@ghost

download the deb python_3.6.2_aarch64.zip which Hax4us had post it on this issue, install it

It has problems with SSL. See #1166 (comment).

@Letaangasu1

Why is this?how I can fix this problem??
Unable to locate package phython2

@Grimler91

@Letaangasu1 phython2 doesn’t exist, you haven’t spelled it correctly

@saravanakumarsk

Plzzzzzz solve my problem
Screenshot_2020-06-09-08-06-32-385_com termux

@saravanakumarsk

@kcubeterm

@saravanakumarsk just install python,
pkg install python
If you want to install python2 then you can install with pkg install python2

@saravanakumarsk

@pyaf

I had the same issue. I solved it with
pkg uninstall python, apt update && apt upgrade, pkg install python

@Shevang88

bro same problem I try pkg install python and pkg install python3 both But same error please help me

@ghost

@Shevang88 pkg install python as Termux provides only python and python2.

@noobanon

here the latest solution i used after wasting my whole night

first download python.deb package according to your need List Of Python download this into your local storage and rename it to python.deb

Note: use uname -m to check your device architecture

in termux now goto your file path where you downloaded your python.deb
storage/emulated/0/foldername
then type [ apt install ./python.deb ]

@termux
termux

locked and limited conversation to collaborators

Oct 9, 2021

Are you using termux app on your android?

If, yes, then i think you’re stuck with this error called “Unable To Locate Package” if you trouble with that then here I have a 99% working solution for you.

Yeah, if you’re using termux or if you’re thinking to install packages on your termux terminal or getting this error then definitely you should follow my steps to fix unable to locate package in termux easily with some simple commands.

So to fix this error we need to set up our storage first, and then we can fix this error, so let’s jump into our main topic and setup our termux storage location and fix the error.

How To Download Termux for Windows 10 – Mac OS?

Steps To Fix Unable To Locate Package in Termux App Android or Pc

First open your terminal and place thise codes:

apt update

Now you ned to do Upgrade your terminal after updating:

apt upgrade

Now its time to place the command to setup your internal storage for package location:

termux-setup-storage

Now you will get a popup message to “allow or deny” so just click on the “Allow” button to get access to your internal storage.

Now when you click on “Allow” then its time to check is it worked or not? so to check this just write another command called.

ls

Then you need to place another command:

cd storage

Now this is the last command to check all folders of your storage to final checking:

ls

That’s set, if you see your internal storage folders are over here then you’re completely set up your location to your internal storage, and now it’s time to install your package to see if the “unable to locate package” error has or not?

I’m dammed sure that, if you successfully follow all the commands then you will didn’t get any error on your terminal, and now you can install anything on your termux app.

Bottom Line

So, it’s time to leave, because i will complete practically showed you the exact way of how to fix unable to locate package error of termux app? and now it’s your turn to follow my all commands and fix your issue.

Also, in return, if you found anything helpful from this article then please do share on your social media or leave a good comment below to motivate me and that’s why I will create for you latest articles related to termux terminal.

The apt-get pip installation error “Unable to locate package python-pip” can occur if your apt repositories are out of date, or if your system uses python3-pip or python2-pip packages instead. You may already have it – check to see if the pip2 or pip3 commands are available.

The other day I was toying around with an older version of Ubuntu. Or, rather, I was stuck using an older version of Ubuntu for reasons I’d rather forget. When trying to install some Python package via pip install <whatever>, I got:

“Hmm, weird” I thought. I could have sworn it was already installed. But, I’ve been in this situation a million times before. I know exactly what to do!

Then I did the next logical thing, and tried running:

sudo apt-get install python-pip

But, unfortunately, that didn’t do what I thought it was going to do. Instead, I was greeted with the following error message:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip

What. That always used to work!

Fortunately, I was able to figure it out. Let’s look at a few different ways you can install pip – one of these will work!

Fix 1: You might already have it!

If you’re not able to run the pip command, it’s possible your system already has it installed as pip2 or pip3 instead. Newer versions of Debian based systems like Ubuntu 20.04 will install Python 2 as “python2” and Python 3 as “python3”. I really look forward to the day when this isn’t the case. Literally nobody should be using Python 2 anymore. It’s been long enough.

Anyway, try the following if you must use Python 2 and need pip as well:

pip2 install <your package>

Or, if you’re really trying to get pip for Python 3, try this:

pip3 install <your package>

Still didn’t work? Alright, well, moving on then…

Fix 2: Try installing python2-pip or python3-pip instead

The next logical step, if pip2 or pip3 didn’t work, is to try installing those. You can short-circuit the guesswork if you can figure out if you have the python2 or python3 commands. Depending on which version of Python you actually want, that is.

If you have one of those, good news! One of the following commands should work.

If you want Python 2 pip, run this:

sudo apt-get install python2-pip

And if you want Python 3 pip, try this one:

sudo apt-get install python3-pip

Still nothing?? Well, don’t worry. I have a few more tricks up my sleeve.

Fix 3: Update your apt repositories

You might just need to update your apt repositories. Unlikely, yes, but still possible. python2-pip or python3-pip should have already been in your apt packages list on install. But, maybe you installed your OS without internet access, or maybe you just… did something weird. I don’t know.

It’s worth a try though, right?

Try the following:

sudo apt-get update && sudo apt-get install python-pip

If that didn’t work, try substituting “python-pip” with one of the specific variations, python2-pip or python3-pip. Yes, we’re grasping at straws here.

Fix 4: Add the “universe” repository

If you made it this far wit no luck, we might be in trouble. But, hang in there. We have a couple more things to try.

You might have some success by installing the “universe” repository. Beware though, these are packages from all over the place, not just the Debian or Ubuntu sanctioned ones. We don’t need their rules anyway, right? Please don’t sue me if you break something – you’ve been warned!

sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-pip

Again, if you don’t have success trying python-pip, try the python2-pip or python3-pip packages instead.

Fix 5: Use the ensurepip module

Python comes with a built-in way to make sure pip in installed. Though, it’s unlikely to work if you’re on Ubuntu or Debian, because they usually disable it. Or, at least, it’s always disabled when I try this. But it’s worth a shot. I’ve been saying that a lot lately… hopefully you haven’t had to read down this far.

python -m ensurepip --upgrade

You’re more than likely going to get the following error or some variation of it:

ensurepip is disabled in Debian/Ubuntu for the system python.
Python modules for the system python are usually handled by dpkg and apt-get.
    apt install python3-<module name>
Install the python3-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.

Rats. Now we’re down to our nuclear option – use the get-pip script.

Fix 6: Use the get-pip.py script

Alright – this is guaranteed to work, but it’s definitely not the best option. Why? Because on Debian and Ubuntu, packages like pip are managed through apt. And if you step outside that package management system, you’re asking for trouble, because now apt doesn’t know what you have installed, and you can’t uninstall or manage dependencies for those packages with apt.

But, if this is an emergency, go ahead and give it a try:

curl https://bootstrap.pypa.io/get-pip.py | python

Or, if you don’t have curl installed and can’t or don’t want to install it, you can use wget instead with the following one-liner:

wget -qO - https://bootstrap.pypa.io/get-pip.py | python2

There you go. Now you should have pip.

You might get the following warning:

WARNING: The scripts pip, pip3 and pip3.9 are installed in '/home/user/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

If you do, that means you’ll have to add /home/<you>/.local/bin to your $PATH environment variable. You can do this (if you use bash) by adding the following to the bottom of your .bashrc file:

You’ll have to log out / log back in again for this to take effect. Or open a new terminal window if you’re logged into the desktop environment.

Conclusion

So there you go, one of those was guaranteed to work. Well, I can’t say “guaranteed”, because there’s always something, but I can say “probably”. Yeah, we’ll go with that. One of those probably worked. If you can think of any possible solutions I may have missed please let me know!

Hope this helped, and if it didn’t, good luck.


Go to termux


r/termux


r/termux

Official Reddit community of Termux project. Share your Termux configuration, custom utilities and usage experience or help others troubleshoot issues.




Members





Online



by

vantech887



How to install python in termux?, I keep getting this error


r/termux - How to install python in termux?, I keep getting this error

Archived post. New comments cannot be posted and votes cannot be cast.

More posts you may like

I have just installed the latest Termux on my Android device and Python 3.9 is the default Python installation. I need to run Python 3.8.x due to some package incompatibilities.

My searching tells me there is no way to downgrade Python within Termux — is this correct?

If I install a previous version of Termux, will this in turn install an earlier version of Python or will it just collect the same default version?

Is there another way for me to make this change?

asked Nov 16, 2020 at 6:50

deldridg's user avatar

1

I’ve encountered something similar over the past few days!

Here is a summary of the solution given by @kcubeterm on Reddit, who has very kindly provided a way to install python 3.8X on Termux.

  1. Remove python 3.9 if you have it installed:
pkg uninstall python
  1. Make a note of the architecture of your device’s CPU using this command:
uname -m
  1. Go to https://github.com/Termux-pod/termux-pod and find the file corresponding to your device’s CPU. According to @kcubeterm, you should try python_3.8.6_.deb first and then the static version if there is any error.

  2. Download the raw .deb file in termux using web-get.

make sure you add ?raw=true to the end of the url, or else you’ll end up downloading the html file!

wget https://github.com/Termux-pod/termux-pod/blob/main/arm/python/python_3.8.6_<CPU_ARCH.>.deb?raw=true
  1. Finally, execute the following command in termux:
dpkg -i ./python_3.8.6_<CPU_ARCH.>.deb

Once again, replacing <CPU_ARCH.> with your cpu’s architecture (for me it was arm).

Hope this answer helped you to install Python 3.8! I love termux but find it frustrating that they provide no way to install non-bleeding edge versions of packages!

Thanks again to @kcubeterm who provided this solution.

answered Nov 19, 2020 at 16:18

Joe Boyle's user avatar

Joe BoyleJoe Boyle

1692 silver badges7 bronze badges

1

git clone the termux-packages repo

then cd to the packages/python folder
git log build.sh to find the commit with the version you want
checkout that commit (for the entire repo, to be sure)

then follow the standard instructions at
https://wiki.termux.com/wiki/Building_packages

Otherwise you don’t know what kind of binary you are installing. Build it yourself to be sure. I’d wanna be sure.

answered Jan 11, 2021 at 18:05

Mike Amy's user avatar

Mike AmyMike Amy

3513 silver badges4 bronze badges

It doesn’t depends upon the Version of termux. It depends upon the repository. And it always update it’s packages . So i think there is no way

answered Nov 16, 2020 at 7:04

Goutham Rajeev's user avatar

install pypy3 using apt

# apt search python

.
.
.
pypy/stable 7.3.9-1 aarch64
  A fast, compliant alternative implementation of Python
.
.
.

# pypy3 --version
Python 3.8.13 (4b1398fe9d76ad762155d03684c2a153d230b2ef, Apr 25 2022, 09:26:53)
[PyPy 7.3.9 with GCC Clang 14.0.1]

answered Jun 23, 2022 at 10:49

M.D's user avatar

M.DM.D

691 gold badge2 silver badges12 bronze badges

Понравилась статья? Поделить с друзьями:
  • Ошибка при установке питона windows 7
  • Ошибка при установке сити скайлайн
  • Ошибка при установке питона 0x80070643
  • Ошибка при установке симс 4 код ошибки 11
  • Ошибка при установке паладинс