Brian Yeh
Brian Yeh

Reputation: 3267

django.core.management not found but django exists when running manage.py

When running this command in my virtual environment:

sudo ./manage.py migrate wifipromo 0088_auto__add_adgrouptimesets
Traceback (most recent call last):
  File "./manage.py", line 2, in <module>
    from django.core.management import execute_manager
ImportError: No module named django.core.management

I get the error above. I checked the shebang in manage.py its "#!/usr/bin/env python" which should be correct.

Additionally when I enter the python console, I can run the following....

(ve)ubuntu@app02:/var/apps/nimbus/nimbus$ python
Python 2.6.5 (r265:79063, Feb 27 2014, 19:43:51)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django
<module 'django' from '/var/apps/nimbus/environments/767a6ca970ca5b5cc5724c3e158f8f53/ve/lib/python2.6/site-packages/django/__init__.pyc'>
>>> django.get_version()
'1.4'

which is strange. Anybody know what's wrong?

Upvotes: 0

Views: 228

Answers (2)

Brian Yeh
Brian Yeh

Reputation: 3267

Turns out the app I sshed into was configured for a specific user. Ubuntu and root aren't configured correctly. This turned out to be a very specific domain problem and I guess its not a good format for this site. Sorry. Thanks for helping everyone.

Upvotes: 0

Velodee
Velodee

Reputation: 41

You're running with sudo (user root), so it can not get info from your virtualenv (user ubuntu). Try to run migrate as normal user.

Upvotes: 2

Related Questions