Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!