Por defecto en Centos tenia Python 2.6, asi que decidí instalar un version mas reciente 2.7.12, mas antes ya había instalado los entornos virtuales(VIRTUALENV y VIRTUALWRAPPER) y resulta que ahora no puedo ni crear un entorno virtual ni ejecutar comandos de linux, me lanza estos errores que detallo:
por ejemplo intento actualizar :
root@vps3 [~]# yum update
me arroja :
-bash: /usr/bin/yum: /usr/bin/python: intérprete erróneo: No existe el fichero o el directorio
hasta he reiniciado mi server y accedo por SSH me arroja este mensaje
/usr/local/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python and that PATH is
set properly.
cuando intento crear un entorno virtual con root@vps3 [~]# mkvirtualenv djangoprueba
arroja este error:
-bash: /usr/bin/virtualenv: /usr/bin/python: intérprete erróneo: No existe el fichero o el directorio
Finalmente lo he eliminado la antigua version de PYTHON por completo al parecer, así esta mi actual instalación:
root@vps3 [~]# type -a python
python is /usr/local/bin/python
python is /usr/local/bin/python
python is /usr/local/bin/python
python is /usr/local/bin/python
ubicando python
root@vps3 [~]# which python
/usr/local/bin/python
cuando acceso en consola me arroja por defecto 2.7.12:
root@vps3 [~]# python
Python 2.7.12 (default, Jul 3 2017, 04:21:53)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
en el cd /usr/bin/python
, veo estos archivos:
python python2 python2.6 python2.6-config python-config
y en root@vps3 [~]# cd /usr/local/bin/python
veo estos archivos:
python python2 python2.7 python2.7-config python2-config python-config
La verdad estoy confundido, no sé que es lo esta fallando, dudo que falta un enlace por defecto a Python de python2.7.12? o que se puede hacer para solucionar, gracias por su ayuda
ln -s /usr/local/bin/python /usr/bin/python
o abre cada script y cambia el intérprete a usar en la primera línea: por ejemplo para yum abresusr/bin/yum
y cambia#!/usr/bin/python
por#!/usr/local/bin/python
$ /usr/bin/python
?$ /usr/bin/python
me arroja´-bash: /usr/bin/python: No existe el fichero o el directorio
´