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

269 views
Skip to first unread message

Nicholas Ling

unread,
Nov 23, 2013, 9:54:48 AM11/23/13
to django...@googlegroups.com

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 
Reply all
Reply to author
Forward
0 new messages