Re: Running into Unicode Decode Error when using django-admin.py startproject.

224 views
Skip to first unread message

Billy Garnet

unread,
Mar 11, 2014, 1:13:17 PM3/11/14
to django...@googlegroups.com
I am having the same issue. Did you find a solution? 
Python is working, Django is reporting a version number. 

When I run django-admin.py startproject mysite I get the folder create and then the following errors:

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/django-admin.py", line 5, in <module>

    management.execute_from_command_line()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line

    utility.execute()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv

    self.execute(*args, **options.__dict__)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute

    output = self.handle(*args, **options)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/startproject.py", line 30, in handle

    super(Command, self).handle('project', project_name, target, **options)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/templates.py", line 156, in handle

    content = content.decode('utf-8')

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode

    return codecs.utf_8_decode(input, errors, True)

UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 37: invalid start byte


On Thursday, 25 April 2013 13:32:32 UTC-4, Eric Nielsen wrote:

I am brand new to Django and I am having a big problem right off the bat. I cannot use startproject to begin my web app. When I use this command:

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/bin/django-admin.py startproject cms

I get this error:

"UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 37: invalid start byte"

and then it doesn't create the web app. I have not even done any programming and it seems like this is something that is wrong with the Django files, but I am really confused as how their own files would have a character not in the English language that would be making this error. I have been searching online and I have found people with Unicode Decode Errors, but not any during this specific step and I have not been able to find an answer so far. I am running Django on a Mac with Snow Leopard and am using the stable version of Django with Python 2.7. I have been trying to figure this out for a while now and I just keep hitting walls, I would really like to try Django. Thanks for any help!

Erik Cederstrand

unread,
Mar 11, 2014, 6:47:42 PM3/11/14
to Django Users
This might be because you have non-ASCII characters somewhere in your file path. Try getting a stacktrace to see where the error comes from:

django-admin.py startproject mysite --traceback

Erik
> --
> 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/1d970720-5e0a-4a8c-8070-4e8d22badfb2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages