Risposte (10)
Soluzione trovata!
Seguendo la documentazione di pip installer , si può semplicemente emettere quanto segue:
# install setup tools
curl https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py | python -
# install pip
curl https://bootstrap.pypa.io/get-pip.py | python -
Non sono riuscito a seguire le risposte precedenti per ottenere easy\install. Ho seguito gli altri comandi per installare pip. (richiede privilegi sudo)
per installare easy\install:
sudo yum install python-setuptools python-setuptools-devel
per installare pip:
sudo easy\install pip
Tutti i pacchetti nei repo saranno compilati per la 2.4. Dovrai installarli dai sorgenti con la 2.7.
python2.7 setup.py install
Ho lanciato questo comando in CentOS 7 e ha funzionato
curl https://bootstrap.pypa.io/get-pip.py | python -
Volevo installare l'ultima versione di Amazon Web Services Client Tools (awscli). Questo è stato fatto su CentOS 64 minimal usando il sistema python: Scarica l'ultimo setuptools (la versione 1.16 può essere trovata qui )
sudo -s
cd /opt
tar xzf <setuptools.tar.gz>
cd setuptools<-1.1.6>
python ez_setup.py
easy_install pip
Ora puoi installare quello che vuoi usando pip. Per esempio,
pip install awscli
Questo metodo è stato molto veloce, mi ha permesso di mantenere il sistema CentOS python.
da http://www.cyberciti.biz/faq/debian-ubuntu-centos-rhel-linux-install-pipclient/ alla maniera di Red Hat, usando il repository EPEL:
[root@paulvps tmp]# wget http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
--2013-12-31 13:49:12-- http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
Resolving mirror-fpt-telecom.fpt.net... 118.69.250.132
Connecting to mirror-fpt-telecom.fpt.net|118.69.250.132|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-redhat-package-manager]
Saving to: “epel-release-6-8.noarch.rpm”
100%[======================================>] 14,540 2.66K/s in 5.3s
2013-12-31 13:49:18 (2.66 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]
[root@paulvps tmp]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@paulvps tmp]# yum install python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink | 13 kB 00:00
* PUIAS_6_core_Base: puias.math.ias.edu
* PUIAS_6_core_Updates: puias.math.ias.edu
* base: centos.sonn.com
* epel: epel.mirror.freedomvoice.com
* extras: centos.mirror.freedomvoice.com
* rpmforge: mirror.webnx.com
* updates: mirrors.tummy.com
epel | 4.2 kB 00:00
epel/primary_db | 5.8 MB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-pip.noarch 0:1.3.1-4.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
python-pip noarch 1.3.1-4.el6 epel 330 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 330 k
Installed size: 1.0 M
Is this ok [y/N]: y
Downloading Packages:
python-pip-1.3.1-4.el6.noarch.rpm | 330 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <epel@fedoraproject.org>
Package: epel-release-6-8.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : python-pip-1.3.1-4.el6.noarch 1/1
Verifying : python-pip-1.3.1-4.el6.noarch 1/1
Installed:
python-pip.noarch 0:1.3.1-4.el6
Complete!
Ero un po’ scettico riguardo al sito fpt.net, che reindirizza a fpt.vn, ma se nixCraft dice che va bene, spero abbiano ragione.
Sembra che ci siano molti modi per installare pip su CentOS, ma il modo che ha funzionato per me è stato il tuo metodo .
sudo python2.7 /usr/local/bin/easy_install pip
Ho provato prima diversi altri modi. Il più comune che ho trovato è stato quello di usare yum con il repository EPEL .
cd /tmp
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
sudo rpm -ivh epel-release-5-4.noarch.rpm
sudo yum -y install python-pip
L'installazione di yum è fallita con l'errore “Nessun pacchetto python-pip disponibile”.
La documentazione del progetto Pip dice di usare lo script get-pip.py, ma anche questo mi ha dato errori.
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install python-pip