ImportError Couldnt import Django
Linux es un sistema operativo tan poderoso que resiste los comandos del usuario inexperto.
Luego de los ya conocidos:
sudo apt update
sudo apt-get upgrade
sudo apt-get -y dist-upgrade
Llegué a instalar, casi de modo transparente, Debian 9 (Strech) sobre Debian 8 (Jessie).
Ya me había yo dado cuenta que necesitaba instalar el kernel más actualizado. Pero ignoraba por qué había perdido mi Django:
En efecto, python manage.py runserver generaba este
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
Luego de algunas búsquedas, volví sobre la actualización mayor del sistema operativo: ni siquiera había tenido el cuidado de actualizar el archivo de fuentes, así que fue lo primero que hice:
sudo gedit /etc/apt/sources.list
Y voilà, Django ha vuelto:
:~ /DjangoProjects/holovaty/mysite$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
July 28, 2017 - 21:58:17
Django version 1.11.3, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Luego de los ya conocidos:
sudo apt update
sudo apt-get -y dist-upgrade
Llegué a instalar, casi de modo transparente, Debian 9 (Strech) sobre Debian 8 (Jessie).
Ya me había yo dado cuenta que necesitaba instalar el kernel más actualizado. Pero ignoraba por qué había perdido mi Django:
En efecto, python manage.py runserver generaba este
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
Luego de algunas búsquedas, volví sobre la actualización mayor del sistema operativo: ni siquiera había tenido el cuidado de actualizar el archivo de fuentes, así que fue lo primero que hice:
sudo gedit /etc/apt/sources.list
#deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160917-15:07]/ jessie main
# Repositorio base
deb http://ftp.mx.debian.org/debian stable main contrib non-free
#deb-src http://ftp.mx.debian.org/debian jessie main contrib non-free
# Actualizaciones de Stable
deb http://ftp.mx.debian.org/debian stretch-updates main contrib non-free
#deb-src http://ftp.mx.debian.org/debian jessie-updates main contrib non-free
# Repositorio backports de la version stable
deb http://ftp.mx.debian.org/debian stretch-backports main contrib non-free
#deb-src http://ftp.mx.debian.org/debian jessie-backports main contrib non-free
# Actualizaciones de seguridad
deb http://security.debian.org/ stretch/updates main
#deb-src http://security.debian.org/ jessie/updates main
## MULTIMEDIA
## Instalar key # apt-get install deb-multimedia-keyring
deb http://www.deb-multimedia.org stable main non-free
# Opera web browser
#deb http://deb.opera.com/opera-stable/ stable non-free
Ya que el framework no se ejecutaba, hice como si no hubiera tenido Django en la máquina: Cómo instalar Django en Debian
:~ /DjangoProjects/holovaty/mysite$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
July 28, 2017 - 21:58:17
Django version 1.11.3, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Comments
Post a Comment
Under your writing