Estou executando o Centos 5.11. Estou tentando instalar o pacote de pedidos python. Mas o pip continua me dando erros de sintaxe.
pip help retorna
[root@32437-201824 bin]# pip help
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 236, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2097, in load_entry_point
return ep.load()
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1830, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.4/site-packages/pip-7.1.2-py2.4.eg/pip/__init__.py", line 211
except PipError as exc:
^
SyntaxError: invalid syntax
qual pip retorna
[root@32437-201824 bin]# which pip
/usr/bin/pip
[root@32437-201824 bin]# yum list installed | grep pip
não retorna nada.
[root@32437-201824 bin]# rpm -qa|grep pip
não retorna nada.
[root@32437-201824 bin]# pip install requests
retorna o mesmo erro da ajuda pip (mostrada acima)
O comando
[root@32437-201824 bin]# rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
warning: /var/tmp/rpm-xfer.szimOy: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing... ########################################### [100%]
package epel-release-5-4.noarch is already installed
O comando
[root@32437-201824 bin]# yum install -y python-pip
Retorna isso depois de algumas linhas,
No package python-pip available.
Nothing to do
Outro método de instalação também possui erros de sintaxe.
[root@32437-201824 tmp]# python get-pip.py
File "get-pip.py", line 43
_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
^
SyntaxError: invalid syntax
O comando
[root@32437-201824 tmp]# python -V
Python 2.4.3
O Python é executado de forma interativa.
[root@32437-201824 tmp]# python
Python 2.4.3 (#1, Jan 9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
[1]+ Stopped python
Então python é executado, mas o pip não será instalado. Eu suponho que algo está fora de sincronia, mas o que é isso?