Меню

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

22.8k27 gold badges91 silver badges119 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

26.2k8 gold badges56 silver badges77 bronze badges

answered Dec 11, 2020 at 11:04

Krishna Kanhaiya's user avatar

1

The combination of the others answers 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

Gino Mempin's user avatar

Gino Mempin

22.8k27 gold badges91 silver badges119 bronze badges

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.

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

sfbarrerab opened this issue

May 4, 2017

· 11 comments


Closed

Python libraries

#984

sfbarrerab opened this issue

May 4, 2017

· 11 comments

Comments

@sfbarrerab

Hi everyone, I am trying to use the python libraries (numpy, matplotlib, etc), but when I run:
packages install python-numpy
I obtained this error:
E: Unable to locate package python-numpy
Someone else have this problem? How can I fix it?

Thanks for your help and sorry for my english (I am from Colombia)

@Grimler91

@its-pointless

i recommend using apt rather than the eggs since hte eggs are no longer updated. Just a single line to sources.list and stuff…

@fornwall

Closing this in favour of the above mentioned #136 issue.

@kirAn-sAi

I also got the same issue while installing numpy, i pip command it is also not working

@Auxilus

@kirAn-sAi

Thank you @Auxilus for your reply. The problem is solved by using the command —> LDFLAGS=» -lm -lcompiler_rt» pip install numpy==1.12

@petacube

kiran-sAi nice try but it does work for me either. i get error saying cannot compile Python.h

@Grimler91

@petacube Python.h is provided by the package python-dev, so install python-dev with pkg install python-devand try again.

@petacube

pkg install python-dev it works!!! am very impressed. as for LDFLAGS, it needs to be export LDFLAGS=»-lm -lcompiler_rt» otherwise pip does not see the env variable

@Grimler91

if you write LDFLAGS="-lm -lcompiler_rt" pip install numpy=1=.12 with everything on the same line then LDFLAGS will be set for only the pip command, locally. Export works as well though.

@Mahesh222

use this command:
python -m pip install pandas

@termux
termux

locked and limited conversation to collaborators

Oct 9, 2021

Я устанавливаю python на termux, и эта ошибка показывает:

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

7 ответов

Я думаю, что вы не обновили репо, похоже, вы только что установили termux. В любом случае, выполнить

apt update

А затем установите любой пакет.


14

wjandrea
11 Дек 2020 в 22:46

Termux вытащил все обновления через google playstore, загрузил их с f-droid, затем поменял зеркало, все работает (иногда)

termux-change-repo

Или измените его вручную, отредактировав

sources.list

Файл в каталоге

$ПРЕФИКС/и т.д./подходящий

Прочтите мою запись в блоге, чтобы найти дополнительную ссылку


5

Th3cr00k3dm4n
24 Июн 2021 в 07:39

Убедитесь, что у вас есть подключение к Интернету, затем разрешите доступ к вашему хранилищу;

Запустите termux-setup-storage, это должно запросить у вас разрешение, чтобы разрешить termux использовать хранилище вашего устройства.

Затем, чтобы убедиться, что хранилище доступно, запустите ls ~/storage/shared, чтобы получить список каталогов, содержащихся в общем хранилище.

Если это не сработает, попробуйте переключить репозитории, как предлагают некоторые другие ответы, поскольку узел, на котором вы находитесь, может быть недоступен.


1

ruzor
11 Июл 2021 в 04:34

Попробуйте обновить Termux через pkg upgrade, тогда он найдет пакеты в pkg


1

Berke Şentürk
9 Окт 2021 в 19:24

Я изменил свой репозиторий termux на A1batross.


0

Silver
15 Июл 2021 в 19:21

Просто дайте разрешение на хранение и перезапустите приложение, у меня это сработало.


-1

Satwik
9 Мар 2021 в 21:08

В моем случае это произошло потому, что я оставил пробел после строки, например. pkg install python и пробел приведут к ошибке, поэтому не ставьте пробел.


-1

cigien
24 Дек 2021 в 20:10

unable to locate package termux

Looking for a step by step guide to fix ‘unable to locate package’ in Termux on Android? Then you are on the right page.

Introduction

Termux is one of the best terminals for Android devices that allows you to run linux commands without having to root your device.

Some of the most popular packages are metasploit, hydra, python, nmap, gem, and Ubuntu. These modules are freely available at the resource server. You can install these packages without rooting your device. In some cases, however, termux throws an unexpected error message, saying, “unable to locate package ___“. It is due to the fact that termux does not have permission to access the local storage.

Termux does not have storage access by default.

So here in this guide, we are going to see ‘how to fix unable to locate package in termux’.

You must manually grant termux access to the local storage to fix this issue.

Let’s see the step by step guide:

  1. First of all, Open termux terminal.
  2. And then run “termux-setup-storage” command without the quote.
  3. Then, a pop-up box will appear asking you to provide permission to get access to the local storage.
  4. Then, tap ‘Allow’.
  5. That’s it.

You can now verify whether the issue is fixed or not. You can run the linux commands as shown below.

ls This command lists all the files and folders in the current folder.
cd This command lets you navigate throughout the folder. Like cd $HOME to navigate to the home directory.
df This command shows the amount of disk space used and available.
mv This command lets you move files between folders.

You are now done.

Conclusion

Unable to locate packages is one of the common problems. A user’s issue arises when the termux terminal isn’t installed with the appropriate permissions on their android device. The solution stated above works with all packages such as metasploit, hydra, nmap, ubuntu, python, etc.

Thank you for reading this article. With the above step-by-step guide, I hope that you have been able to resolve your issue regarding the package. Feel free to post a comment if you’re still having trouble. I would be happy to answer any questions you have.

Create an account to follow your favorite communities and start taking part in conversations.

r/termux

Posted by2 years ago

Archived

r/termux - Unable to locate package

This thread is archived

New comments cannot be posted and votes cannot be cast

level 1

I write only because google can go stick it 😛 But in the future a search engine is your best bet for an answer.

pkg install python

pip install youtube-dl

youtube-dl <link>

Hope you have your storage access granted.

level 1

Pip is bundled with python package So to get pip type apt install python And pip is automatically installed. To verify the pip installation type: pip -V and the output will be something like pip 20.3.3 from /data/data/com.termux/files/usr/lib/python3.9/site-packages/pip (python 3.9)

level 1

Run apt-list and see that the file exists or not in the list.

level 2

Termux doesn’t provide apt-list. Probably you meant apt list as this one will run successfully.

level 2

what are the differences between the 2 ? dl and dlc

About Community

Subreddit Icon

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



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.

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

5 Answers

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

apt update

and then install any package.

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

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.

I changed my termux repository to A1batross’s

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

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • U3f00 ошибка бмв е90
  • U3f00 ошибка бмв e60