kdipanshu
kdipanshu

Reputation: 31

Not able to install Django on windows 7

I am trying to install Django-1.5.5 on windows 7. I have installed it but when I try to punch in "django-admin.py startproject mysite" I get following error:

C:\Users\DIPANSHU>django-admin.py startproject mysite
Traceback (most recent call last):
  File "C:\Django-1.5.5\django\bin\django-admin.py", line 2, in <module>
    from django.core import management
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
9, in <module>
    from django.core.management.base import BaseCommand, CommandError, han
fault_options
  File "C:\Python27\lib\site-packages\django\core\management\base.py", lin
in <module>
    from django.utils.encoding import force_str
  File "C:\Python27\lib\site-packages\django\utils\encoding.py", line 10,
dule>
    from urllib import quote
  File "C:\Python27\lib\urllib.py", line 26, in <module>
    import socket
  File "C:\Python27\lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: The specified procedure could not be found.

Previously, I tried with Django-1.4.2 but problem was same. I am having Python27.Please assist.

Upvotes: 0

Views: 1064

Answers (2)

kdipanshu
kdipanshu

Reputation: 31

Yups! Finally got it! So here's what I did:

  1. Removed python completely and installed it again.
  2. adjust my PATH environment variable to include paths to the Python executable & additional scripts.
  3. Installed Setuptools
  4. Installed pip using easy_install pip.
  5. Installed Django using pip install django.

Note: If your Python is installed in C:\Python27\, the following paths need to be added to PATH: C:\Python27\;C:\Python27\Scripts;

Reference: https://docs.djangoproject.com/en/dev/howto/windows/

Thanks a lot for your valuable inputs and bearing with me! :-)

Upvotes: 1

windigo
windigo

Reputation: 35

I would make sure that DJango is installed by running

python -c "import django; print(django.get_version())"

https://docs.djangoproject.com/en/1.6/intro/tutorial01/

I found the Django tutorial on their site to be very good

Also what exactly are you typing into the command prompt ? You should simply be in directory C:\Users\DIPANSHU> in the command shell

EDIT: you should be in the directory where you installed Django

Upvotes: 0

Related Questions