Sunday, March 31, 2013

Re: I get import errors when I run django-admin.py startproject in Windows

Thanks for your help Karen.

I enter 
python C:\python33\scripts\django-admin.py startproject mysite

The response I get is
Traceback (most recent call last):
  File "C:\Python33\lib\site-packages\django\core\management\templates.py",
line  12, in <module>
    from urllib.request import urlretrieve
  File "C:\Python33\lib\urllib\request.py", line 88, in <module>
    import http.client
  File "C:\Python33\Lib\site-packages\django\http\__init__.py", line 1, in <module>
    from django.http.cookie import SimpleCookie, parse_cookie
  File "C:\Python33\lib\site-packages\django\http\__init__.py", line 1, in <module>
    from django.http.cookie import SimpleCookie, parse_cookie
  File "C:\Python33\lib\site-packages\django\http\cookie.py", line 5, in <module>
    from django.utils.six.moves import http_cookies
  File "C:\Python33\lib\site-packages\django\utils\six.py", line 84, in __get__
    result = self._resolve()
  File "C:\Python33\lib\site-packages\django\utils\six.py", line 103, in _resolve
    return _import_module(self.mod)
  File "C:\Python33\lib\site-packages\django\utils\six.py", line 74, in _import_module
    __import__(name)
ImportError: No module named 'http.cookies'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\python33\scripts\django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line
453, in execute_from_command_line
    utility.execute()
  File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line
392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line
272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line
77, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python33\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Python33\lib\site-packages\django\core\management\commands\startproje
ct.py", line 2, in <module>
    from django.core.management.templates import TemplateCommand
  File "C:\Python33\lib\site-packages\django\core\management\templates.py", line
 14, in <module>
    from urllib import urlretrieve
ImportError: cannot import name urlretrieve


My path includes my Python directory and Scripts sub-directory. My Python path includes Python\DLLs, Python\Scripts and Python\Lib\site-packages\django. I hope that this gives you the information you need to help me out. If not, please tell me what else I can provide. Thanks again for your help.


On Sunday, March 31, 2013 6:33:39 AM UTC-7, Karen Tracey wrote:
What errors, exactly? Without some specifics of what's going wrong it's hard to offer help. Copy/paste of exactly what you are entering and getting in response would help.



--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment