0

This is a project written by other people and I am working on adding new features to the project. I am new to python and django so the previous developer helped me setup the environment. It worked fine in the past, but today when I tried to run the server it gave me the error:

(genienv)Xueyangs-MacBook-Pro:userservice xueyangli$ python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

This is weird because the previous developer did install django on my labtop(otherwise how can I run the server successfully before). But I still run

pip install django

to install django again. Then it downloaded and installed django successfully. Then I tried to run the server again, then it gave me this error:

Xueyangs-MacBook-Pro:userservice xueyangli$ python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/xueyangli/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/xueyangli/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/Users/xueyangli/anaconda/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/xueyangli/anaconda/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/xueyangli/anaconda/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/Users/xueyangli/anaconda/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named provider

I could not figure this out and would really appreciate any help. The only reason I could think of which cause this problem is probably I installed anaconda for my other project. But it is just a possibility, I am not sure whether it has any effects.

Shawn Li
  • 99
  • 2
  • 13
  • 2
    Your developer almost certainly installed things inside a virtualenv, which you need to activate before you can run the server. – Daniel Roseman Feb 23 '15 at 19:08
  • I did activate the virtualenv, even though the second code piece did not show (genienv) at the beginning as the first code piece did.(that's because I did not activate it when I tried to generate the error log again after I closed the initial terminal.... but even when I did activate, the same error occurred.) – Shawn Li Feb 23 '15 at 23:13

1 Answers1

1

Please do this

python -m pip install django --upgrade

make sure you have all the required packages installed first and they are listed in the django document

Naiem Soliman