how to solve the problem while apduting python3 on linux - python

I have python 3.5.3
I m trying to upgrade to python 3.7.2
I used the cammand bellow :
sudo apt install python3.7.2
I got the following message
E: Unable to locate package python3.7.2
E: Couldn't find any package by glob 'python3.7.2'
E: Couldn't find any package by regex 'python3.7.2'
I used the command below to fix it
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python3.7.2
and I till have the same problem

I found this in the Internet by searching your first error message.
Hello,
Have you tried running python3.7 --version instead of only python3?
If this still does not work what I would suggest is following these steps here:
Run a quick update and install the following package:
apt update
sudo apt install software-properties-common
Add the following to your source list:
sudo add-apt-repository ppa:deadsnakes/ppa
Note: In case that you get prompted just press Enter to continue
After that install Python 3.7 with the command that you’ve specified in your question:
sudo apt install python3.7
Then again test this with:
python3.7 --version
Hope that this helps!
https://www.digitalocean.com/community/questions/unable-to-install-pyhton-3-7-version-on-ubuntu-16-04-error-couldn-t-find-any-package-by-regex-python3-7

Related

Error message when trying to run PyAudio in Visual Studio Code (Flatpak)

Linux Mint 20.1
I was about to run a python program in Visual Studio Code (Flatpak), but then I got the following error message: NOTE: You must install tkinter on Linux to use MouseInfo. Run the following: sudo apt-get install python3-tk python3-dev. I ran the former code in my terminal, but I still get the error message.
Please help!
I was trying following commands in terminal
sudo dnf install python-tk
sudo dnf install python3-tk
sudo dnf install python3.8-tk
Then, I checked pip version
pip --version
pip 20.2.2 from /usr/lib/python3.9/site-packages/pip (python 3.9)
sudo dnf install python3.9-tk
pip3 install tkinter
I was getting same output each time
No match for argument: python3.x-tk
Error: Unable to find a match: python3.x-tk
Then, I tried
sudo dnf install python3-tkinter
In few moment I had successfully got the packages of tkinter. I used sudo dnf cause I was using Linux Fedora. If you are using Linux Arch than, try sudo pacman. If you using Linux Mint, Kali Linux or something else than, try sudo apt-get
So, you should try
sudo apt-get install python3-tkinter
double check that you have pip installed

E: Package 'python-pip' has no installation candidate

$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
both my pip and pip3 are installed in python 3
pip -V
pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)
pip3 -V
pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)
Now i cant install pip
...it shows above error
If you have python(python2) installed you then you can use following command to install pip(for python2).
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
Now you can check for pip2
pip2 --version
I hope these will help you
Just for reference, this problem can occur if you are using Windows Ubuntu Shell and your firewall is blocking your Ubuntu sandbox's traffic. In that case installation resources can not be found and simple apt-update will not work.
In order to test if the firwall causes your problem, you can simply try to ping a website. Also if apt-update will fail with connection refused the firwall is likely your problem. Check this post on how to add your sandbox to the firewall whitelist (Endpoint Protection).
Use these commands first then try again and perform a reinstallation by sudo apt reinstall python3-pip
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo apt-get update

Unable to install python-pip module [duplicate]

I am trying to install mininet-wifi. After downloading it, I have been using the following command to install it:
sudo util/install.sh -Wlnfv
However, I keep getting the error:
E: Unable to locate package python-pip
I have tried multiple times to download python-pip. I know mininet-wifi utilizes python 2 instead of python 3. I have tried to download python-pip using the command:
sudo apt-get install python-pip
But that leads to the same error:
E: Unable to locate package python-pip
Pip for Python 2 is not included in the Ubuntu 20.04 repositories. You need to install pip for Python 2 using the get-pip.py script.
1. Start by enabling the universe repository:
sudo add-apt-repository universe
2. Update the packages index and install Python 2:
sudo apt update
sudo apt install python2
3. Use curl to download the get-pip.py script:
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
4. Once the repository is enabled, run the script as sudo user with python2 to install pip :
sudo python2 get-pip.py
If an error occurs, as a fallback, the specific 2.7 version of get-pip.py can be used:
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
Pip will be installed globally. If you want to install it only for your user, run the command without sudo. The script will also install setuptools and wheel, which allow you to install source distributions
Verify the installation by printing the pip version number:
pip2 --version
The output will look something like this:
pip 20.0.2 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
Since Python 2 is past its end-of-life, few packages for Python2 are included in 20.04. You have to install pip for Python 2 manually:
First, install Python 2:
sudo apt install python2
Then, follow https://pip.pypa.io/en/stable/installing/ , using python2:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python2 get-pip.py
You can run the second step with sudo. If you don't use sudo, you'll need to change PATH, as suggested by the installation message. Alternatively, and possibly better (since it doesn't change PATH), use
python2 -m pip
whenever you need pip2.
In my case, the curl command for downloading get-pip.py gave a syntax error on running sudo python get-pip.py.
But manual download by visiting https://bootstrap.pypa.io/ and downloading get-pip.py worked fine for me.
I've found that creating a virtualenv for Python 2.7 installs also pip
$ virtualenv -p python2 venv
$ . venv/bin/activate
$ pip --version
pip 20.0.2 from /home/.../venv/lib/python2.7/site-packages/pip (python 2.7)
Put python3 instead ${PYPKG} in line 202, and instead python-pip in line 596 in file install.sh of mininet-wifi.
To solve the problem of:
E: Unable to locate package python-pip
Run the package update index cmd:
sudo apt update
If not that, then python-pip-whl (which is also a package installer) is available in the universe repository, make sure that's installed and then run:
sudo apt-get install python-pip-whl
I specifically needed a Dockerfile file and this is what I have put inside so that it works without errors, I hope it will help someone.
This is Dockerfile file:
FROM ubuntu:latest
RUN apt-get update -y
RUN apt-get install -y python3 python3-dev
WORKDIR /app
COPY . /app
ENV DEBUG=True
EXPOSE 80

Ubuntu says Python is on its latest version when its not. How do I update it

I am clueless here. I need to upgrade to python 3.8.0. So, I run this:
sudo apt-get install python3 3.8.0
But I get the following message:
As you can see. It writes "python3 is already the newest version". It is not.
Also, I get the "held broken packages" error after that. I am not sure if they are related.
you might have the newest version of tthat particular's repository.
try here:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.8
sudo apt install python3.8-distutils
python3.8 -m pip install --upgrade pip setuptools wheel

Error while installing python-pip

I'm trying to install Superset (Airbnb Data visualizer) on an equivalent of "PuTTY" installed by the firm I'm working for on a Windows computer, following this tutorial : http://airbnb.io/superset/installation.html
After the first lines (sudo yum install ...) I tried this line :
pip install virtualenv
And I had:
"bash: pip: command not found".
I tried the following :
sudo easy_install pip
sudo yum install python-pip
yum install -y python-pip # after a yum -y update
It still doesn't work... I have errors everytime, particularly this one :
Loaded plugins: rhnplugin, search-disabled-repos This system is
receiving updates from RHN Classic or Red Hat Satellite. No package
python-pip available. Error: Nothing to do
Then I found solutions on the web, I tried this :
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
But I have an error again (Name or service not known).
I absolutely do not know what to do. Do you have an idea to solve this problem ?
Thank you for your help.
Edit : I found more détails : I use a RedHat Linux 7.2-11
I would try and install pip using the first option from the Pip page.
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

Categories

Resources