Startproject failing on Django 1.6

249 views
Skip to first unread message

Steve Sawyer

unread,
Nov 12, 2013, 12:14:27 PM11/12/13
to django...@googlegroups.com
Django 1.6
Python 3.3
Windows 7 pro

I've been anxiously awaiting Django 1.6 as I've been learning Python 3 for the last year.

I tried unsuccessfully to go through the tutorial using Django 1.5.5, and figured I should wait
for 1.6 to be released so I could avoid having to research and resolve version incompatibility issues.

However, today I removed my prior Django installation, successfully installed Django 1.6, and
started into the tutorial, but am again failing on this step:

django-admin.py startproject mysite

I'm getting an ImportError: No module named 'http.cookies'

Note that I've verified that I have a folder named 'http', that this folder is in my PYTHONPATH, that it
contains a module named cookies.py and that the folder contains an __init__.py file.

Any suggestions as to what I need to do to resolve this? I'm not making much progress with the tutorial! :-)


Thanks.

Avraham Serour

unread,
Nov 12, 2013, 1:15:17 PM11/12/13
to django...@googlegroups.com
why are you using this font/size? it hurts my eyes trying to read and makes understanding difficult

in any case, you didn't need to wait for 1.6 to be released, if your objective is to learn and you are not deploying production systems yet you could use the RC, or if before that you could use the beta or before that the dev trunk or even use python 2.7 in the meantime, nothing wrong with that.

how did you install django? I recommend using pip to install python packages

success
avraham


--
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...@googlegroups.com.
To post to this group, send email to django...@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/3611ff1b-c2a6-4270-b888-1234b91d1d09%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Steve Sawyer

unread,
Nov 12, 2013, 1:35:07 PM11/12/13
to django...@googlegroups.com
Sorry for the typeface - it was the default that the page gave me and didn't bother to change it (it also wouldn't word-wrap, so my apologies also for the ragged layout).

In any case, 1.6 is out now, and I'm trying to get started with Django but can't get to 1st base here. I did use pip to install it and it installed successfully.

Tom Evans

unread,
Nov 13, 2013, 8:51:05 AM11/13/13
to django...@googlegroups.com
On Tue, Nov 12, 2013 at 6:35 PM, Steve Sawyer <ssaw...@gmail.com> wrote:
> Sorry for the typeface - it was the default that the page gave me and didn't
> bother to change it (it also wouldn't word-wrap, so my apologies also for
> the ragged layout).
>
> In any case, 1.6 is out now, and I'm trying to get started with Django but
> can't get to 1st base here. I did use pip to install it and it installed
> successfully.
>

You almost certainly have remnants of your previous installation of
django hanging around, which is causing your problems. You will need
to completely remove the previous installation first, especially
django-admin.py.

Cheers

Tom

Steve Sawyer

unread,
Nov 13, 2013, 8:31:56 PM11/13/13
to django...@googlegroups.com, teva...@googlemail.com
Thanks, Tom - however, I completely removed the Django 1.5 folders prior to installing Django 1.6, so unless there are Django components installed outside of those folders, I should be good.

It seems that I might have something mis-configured. I have the http.cookies module and I've done everything I can think of to ensure that it can be found by Python, but so far I'm not having any luck. I think this is the issue, and it may not be specific to Django at all.

Ramiro Morales

unread,
Nov 13, 2013, 8:51:19 PM11/13/13
to django...@googlegroups.com
On Wed, Nov 13, 2013 at 10:31 PM, Steve Sawyer <ssaw...@gmail.com> wrote:
> Thanks, Tom - however, I completely removed the Django 1.5 folders prior to
> installing Django 1.6, so unless there are Django components installed
> outside of those folders, I should be good.
>
> It seems that I might have something mis-configured. I have the http.cookies
> module and I've done everything I can think of to ensure that it can be
> found by Python, but so far I'm not having any luck. I think this is the
> issue, and it may not be specific to Django at all.

Do you by chance have both Python 2.x and 3.x installed side by side?

Because http.cookies got added (or rather moved to that path) in Python 3.

If so, make sure you install Django to and with your chosen Python. It
could be that you installed it in Python3 but e.g. the python.exe
interpreter binary one that has precedence in your PATH is the 2.x
one, etc.

Also, don't simply try to use::

django-admin.py startproject blah

because on Windows the options to get interpreted languages scripts
like django-admin.py to be transparently executed through their
respective interpreter just like if they were simple apps are (still)
unreliable and ugly.

It's better to be explicit and simply specify the full path to both
you python.exe and to django-admin.py, e.g.::

c:\python3.x\python c:\the\full\path\to\django-admin.py startproject blah

This (using python explicitly) is something we tried to make more
clear in some recent changes to the Django docs but I'm seeing now we
missed it some places.

HTH

--
Ramiro Morales
@ramiromorales

Steve Sawyer

unread,
Nov 14, 2013, 12:17:53 PM11/14/13
to django...@googlegroups.com
Ramiro - I only have a single version of Python installed (I have the luxury of being able to keep things simple).

I just tried this again though, using the explicit pathing you recommend. I note that I have two copies of django-admin.py, but they're identical - one in C:\Python33\Scripts, and the other in site-packages. In any case, I'm still getting the ImportError.

I can see that there is an http package that apparently belongs to the python standard library, contains a cookies.py module and is located here:

C:\Python33\Lib\http

However, Django installs another http package

C:\Python33\Lib\site-packages\django\http

And this folder contains a file "cookie.py" (singular).

In any case, I'm not sure what module is expected to be imported. However, I note that if I try to import http from an interactive session, the __init__.py in the Django http package is executed, and I end up getting the same ImportError.

Petra Moessner

unread,
Jan 7, 2014, 10:41:24 AM1/7/14
to django...@googlegroups.com, ssaw...@gmail.com
Probably your versions of Python and Django aren't compatible. I got the same error using Python 2.7.3 and Django 1.6. I upgraded to Python 2.7.6 and the error error went away.

trojactory

unread,
Jan 7, 2014, 12:57:47 PM1/7/14
to django...@googlegroups.com, ssaw...@gmail.com
Hi Steve,

This is usually due to a path issue or an environment variable being previously set. Did you try using virtualenv? It is designed for isolating one python installation from another. I recently documented my experience on installing Python 3 on Windows and running virtualenv here: http://arunrocks.com/guide-to-install-python-or-pip-on-windows/

Hope it helps.

Regards,
Arun
Reply all
Reply to author
Forward
0 new messages