Unable to locate package python termux ошибка

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.8k28 gold badges92 silver badges130 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.3k9 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

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.

Solution 1

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

apt update

and then install any package.

Solution 2

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

Solution 3

The combination of the previous answers worked for me

  1. termux-setup-storage
  2. termux-change-repo (I’m select Albatros)
  3. pkg upadte and pkg upgrade
  4. exit and restar termux
  5. pkg install python -y

Solution 4

Download it from Fdroid insted of Playstore.
pasting the link below:-
: https://f-droid.org/en/packages/com.termux/

Solution 5

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.

Comments

  • i am installing python on termux and this error is showing:

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

  • I have this issue (not able pkg install proot) after pkg update, this answer fixed it.

  • Hi ruzor and welcome to SO. Maybe you can show in your answer more details about the output of these commands :) . Anyway I think would be nice if you read this: stackoverflow.com/help/how-to-answer

  • Thanks a lot mate. I kept trying other solutions but it kept giving same error. When I explicitly granted the storage permission, it worked with steps mentioned by other answers.

Recents

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.

Today we are going to learn

There are many reasons behind it. May be package you are searching for not available in the Termux repository.

You may need to correct the spelling for the particular package name or that package has not been added to the repository list. Today we are going to add all the possible packages for Termux.

These are the available package list container for some extra programs for Termux. You can also install Black Termux to add some more packages and follow the commands below:
Ensure that you already have installed the latest version of Termux and Termux API from the F-droid app store (provide all the permissions to termux and Termux API manually).

$ pkg update && pkg upgrade 
#Provide storage permissions
$ termux-setup-storage

#Locate package in termux
$ termux-change-repo
or
$ nano $PREFIX/etc/aptsources.list
$ pkg list-all |grep "package name you want to install"
Or install some more packages containers types. 
$ pkg install unstable-repo
$ pkg install x11-repo
$ pkg install root-repo
$ pkg install science-repo
$ pkg install game-repo
$ curl -LO https://its-pointless.github.io/setup-pointless-repo.sh
$ bash setup-pointless-repo.sh

#Check
$ ls ~/storage/shared

[ Final step ]
Update and upgrade 
$ pkg update && pkg upgrade -y

#This will also fix unable to locate package python on Termux
$ apt install python
$ apt install ruby
$ apt install php
$ apt install git
$ apt install curl
$ apt install wget
$ apt install vim
$ apt install tor

You can install termux black it has more Hacking repositories.

  • Unable to locate adb android studio ошибка
  • Unable to build entity manager factory ошибка фсс при запуске
  • Unable to authenticate session oracle ошибка
  • Unable to attach geometry ошибка ansys
  • Unable to access location ошибка ubuntu