Saturday, November 23, 2013

Did not manage to run manage.py runserver (Django 1.6, Python 2.7.6 on Mac 10.8.5)

Hi guys

i'm new to python as well as django. Seeking help for this problem when im running the command "python manage.py runserver" in Terminal for tutorial in  https://docs.djangoproject.com/en/1.6/intro/tutorial01/

The development server

Let's verify this worked. Change into the outer mysite directory, if you haven't already, and run the command python manage.py runserver. You'll see the following output on the command line:

 i got this error message in Terminal

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 7, in <module>
    from django.core.exceptions import ImproperlyConfigured
  File "/Library/Python/2.7/site-packages/django/core/exceptions.py", line 7, in <module>
    from django.utils.encoding import force_text
  File "/Library/Python/2.7/site-packages/django/utils/encoding.py", line 11, in <module>
    from django.utils.six.moves.urllib.parse import quote
  File "/Library/Python/2.7/site-packages/django/utils/six.py", line 86, in __get__
    result = self._resolve()
  File "/Library/Python/2.7/site-packages/django/utils/six.py", line 129, in _resolve
    module = _import_module(self.mod)
  File "/Library/Python/2.7/site-packages/django/utils/six.py", line 76, in _import_module
    __import__(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 26, in <module>
    import socket
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 47, in <module>
    import _socket
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so, 2): Symbol not found: __PyInt_AsInt
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so


Manage to bypass error to continue the tutorial by typing

sudo python manage.py runserver
 
However, would like to understand whats the issue here, if anyone is kind enough to explain. Thanks! :D

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so, 2): Symbol not found: __PyInt_AsInt
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so

Warmest,
Nicholas 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e5ff0e8e-585a-43ab-8bdc-7eb212d317bb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment