Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
Python/Django "Import Error" in project directory

I've been having troubles with this and cannot find the solution... I've browsed all SO questions about this but nothing worked in my case... So here's the problem:

  1. I clone a project from git repository
  2. Set up a virtualenv called env in project base dir with proper Python version(2.7) & install all reqs succesfully
  3. Here's where it gets fun... I navigate to the folder that has my manage.py and do a python manage.py makemigrations which results in

from foo.bar.data import CoolioClass

ImportError: No module named foo.bar.data

My directories look like this (just for illustration):

project_root/
     ├──env/
     ├──django/
     │      ├── app
     │      │   └── models.py (from foo.bar.data import CoolioClass)
     │      ├── django
     │      │   └── settings.py
     │      └── manage.py
     └──foo/
        ├── bar
        │   ├── __init__.py
        │   ├── data.py
        │   └── test.py
        ├── baz
        │   ├── __init__.py
        │   ├── data.py
        │   └── test.py
        └── __init__.py

When I print sys.path in python shell it results in:

/home/johnny/project_root/env/lib/python2.7
/home/johnny/project_root/env/lib/python2.7/plat-x86_64-linux-gnu
/home/johnny/project_root/env/lib/python2.7/lib-tk
/home/johnny/project_root/env/lib/python2.7/lib-old
/home/johnny/project_root/env/lib/python2.7/lib-dynload
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/home/johnny/project_root/env/local/lib/python2.7/site-packages
/home/johnny/project_root/env/lib/python2.7/site-packages
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda