Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

112
Views
ImportError: No module named celery with django in virtual env

I am fairly new to Django. I am running a server with existing django project in virtual env, but I am facing an error

"ImportError: No module named celery".

So I ran sudo pip install celery and the result was "Successfully installed celery billiard pytz kombu amqp vine".

I ran python manage.py runserver 0.0.0.0:8000 again, but the result was the same.

Why is that? What shall I do in order to run server with my existing django project?

My manage.py file is like:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "vex.settings")
    try:
        from django.core.management import execute_from_command_line
    except ImportError:
        # The above import may fail for some other reason. Ensure that the
        # issue is really that Django is missing to avoid masking other
        # exceptions on Python 2.
        try:
            import django
        except ImportError:
            raise 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?"
            )
        raise
    execute_from_command_line(sys.argv)

My django-admin version is 1.11.

8 months ago · Santiago Trujillo
1 answers
Answer question

0

If you're in a virtualenv, don't install with sudo since that ignores the virtualenv. Just do pip install celery.

8 months ago · Santiago Trujillo Report
Answer question
Find remote jobs