Need to install python packages like pip, numpy, cv2 on an Amazon EC2 instance of Ubuntu. I tried using sudo apt-get install python-pip but got below given error:
ubuntu#ip-172-31-35-131:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
Try first sudo apt-get update then
sudo apt-get install python-pip
Have you tried the instructions here?
You can install pip from PyPa directly:
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
Your system may have a concurrent python3.x under the name python3, then you can install pip for it with python3 get-pip.py --user as well. (Or contrarily, python2.x under the name python2.)
Related
I like to use PocketSphinx speech recognition engine. For that, libpulse-dev is one of the dependencies. However, I cannot install libpulse-dev in my system.
I used the following command to install the package:
sudo apt-get install libpulse-dev
And I get the following output:
Building dependency tree
Reading state information... Done
Package libpulse-dev 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
E: Package 'libpulse-dev' has no installation candidate
What should I do?
Thank you in advance...
Your /etc/apt/sources.list is misconfigured, edit it as follows:
deb http://us.archive.ubuntu.com/ubuntu focal main restricted
deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://us.archive.ubuntu.com/ubuntu focal-updates main restricted
Then run:
sudo apt update
sudo apt install libpulse-dev
if anyone are using CentOS 7 try do this:
sudo yum install pulseaudio-libs-devel
sudo yum install alsa-lib-devel -y
sudo yum install portaudio
pip3 install --upgrade pocketsphinx
...or try it:
pip3 install pipwin
pipwin install pyaudio
$ 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
I'm tearing what's left of my hair out trying to figure out how to install Kivy on Linux. I'm a newb to pretty much everything, so not incredibly surprising, but I'm trying to make a Makefile that will install the necessary dependencies for my app that I build via Kivy.
This is my Makefile:
#!/bin/sh
all: packages program
packages:
sudo apt-get install python3-kivy
sudo apt-get install python3-pip
sudo apt-get install python-setuptools python-dev build-essential
sudo apt-get install python3-dev
sudo apt-get docutils-doc python3-pygame python-pil-doc python3-pil-dbg ttf-bitstream-vera
sudo easy_install pip
sudo apt-get -f install
pip install --upgrade pip
pip3 install python3-weather-api
sudo pip install requests
pip3 install beautifulsoup4
pip3 install Cython
pip3 install h5py
pip3 install kivy
program:
python3 project.py
This is the output:
sudo apt-get install python3-kivy
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-kivy is already the newest version (1.10.0-0~stable0+201708191146~pkg175~ubuntu16.04.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
python3-kivy : Depends: python3-kivy-common (= 1.10.0-0~stable0+201708191146~pkg175~ubuntu16.04.1) but it is not going to be installed
Depends: python3-kivy-bin (= 1.10.0-0~stable0+201708191146~pkg175~ubuntu16.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Makefile:5: recipe for target 'packages' failed
It keeps saying to run apt-get -f install, which I did, but the same error keeps popping up.
I am very new to Ubuntu OS and Python as well. I want to install Django. But i dont have easy_install and I tried below command to install pip
sudo apt-get install python-pip
I got an error as below
Unable to locate package python-pip
I tried below command as well
sudo apt-get install python-pip
and i got error as below
E: Package 'python-setuptools' has no installation candidate
I am very confused in installing django, How to successfully install django
First update repositories
sudo apt-get update
then try
sudo apt-get install python-pip python-dev build-essential python-setuptools
if nothing, you can install pip and setuptools packages manually. Download them from PyPI.
Install pip
To install or upgrade pip, securely download get-pip.py.
Then run the following (which may require administrator access):
sudo python get-pip.py
If setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.
To upgrade an existing setuptools (or distribute), run pip install -U setuptools
Upgrade pip
On Linux or OS X:
sudo pip install -U pip
Then you can download django using pip,
sudo pip install django
Install
First you need make sure you have Python install, here I take 2.7.6 as example. For how to install Python, you can go check this link:
https://askubuntu.com/questions/443048/python-2-7-6-on-ubuntu-12-04-how-to
Then you can start install Django and setup database as follow:
sudo apt-get install python-django
sudo apt-get install mysql-server
sudo apt-get install python-mysqldb
You can find more configuration detail in this link
http://yuwenqing.org/?p=108
Also, for less pain in future develop, you should deploy your Django application in python virtualEnv, here are some detail of why you need virtualEnv.
http://yuwenqing.org/?p=126
Im trying to install mitmproxy on a Ubuntu 14.04 computer, but I'm getting error. I found on the web how I should install it by using this code:
sudo install pip mitmproxy
So I installed python, now when I run the command it works until I get this problem:
Command python.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
I tried to update python but still the same
Exactly I installed python in this way:
sudo apt-get install python-pyasn1 python-flask python-urwid
What's wrong???
UPDATE
Here is the pip.log
You can also pip install from github:
In this order:
Install netlib: (sudo) pip install git+https://github.com/mitmproxy/netlib.git
Install mitmproxy: (sudo) pip install git+https://github.com/mitmproxy/mitmproxy.git
This will install all requisite libraries and provide you with the most up-to-date version of mitmproxy.
Judging by the log you got from pip the problem here is that the development libraries for libffi are not installed. You can rectify it with:
$ sudo apt-get install libffi-dev
and retry installing.
The clue in your error log is this line:
Package libffi was not found in the pkg-config search path.
If pkg-config is unable to find a library it means that the files needed to develop with this library are missing. On an Ubuntu or Debian system this usually means installing the package that has the name of the library plus -dev.
Running these 2 commands worked for me (Ubuntu 14.04)
sudo apt-get install python-pip python-dev libffi-dev libssl-dev
libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev
sudo pip install mitmproxy
EDIT: You need to run this command before you will be able to use "mitmproxy -p port_number". since it gives error "Error: mitmproxy requires a UTF console environment."
export LC_ALL=en_US.UTF-8
EDIT 2: After installation, you need to generate certificate first and have to transfer it into your device then setup manual proxy by entering your computer's IP address and port on which you will run mitmproxy server. Use below commands to generate certificate:
sudo apt-get install libnss3-tools
certutil -d sql:$HOME/.pki/nssdb -A -t C -n mitmproxy -i ~/.mitmproxy/mitmproxy-ca-cert.pem
$ pip uninstall mitmproxy netlib
$ sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-pip libxml2-dev libxslt-dev git
$ sudo pip install git+https://github.com/mitmproxy/netlib.git#master
sudo pip install git+https://github.com/mitmproxy/mitmproxy.git#master
$ sudo python #
>>> from netlib import certffi
>>> exit()