Rafał M.
Rafał M.

Reputation: 31

django-admin error with decoding

I have a problem with " django-admin startproject mysite . " command. When I try to execute it, Cygwin returns me an error:

Traceback (most recent call last): File "/usr/bin/django-admin", line 9, in load_entry_point('Django==1.10.2', 'console_scripts', 'django-admin')() File "/usr/lib/python2.7/site-packages/Django-1.10.2-py2.7.egg/django/core/management/init.py", line 367, in execute_from_command_line utility.execute() File "/usr/lib/python2.7/site-packages/Django-1.10.2-py2.7.egg/django/core/management/init.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.7/site-packages/Django-1.10.2-py2.7.egg/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/usr/lib/python2.7/site-packages/Django-1.10.2-py2.7.egg/django/core/management/base.py", line 345, in execute output = self.handle(*args, **options) File "/usr/lib/python2.7/site-packages/Django-1.10.2-py2.7.egg/django/core/management/commands/startproject.py", line 34, in handle super(Command, self).handle('project', project_name, target, **options) File "/usr/lib/python2.7/site-packages/Django-1.10.2-py2.7.egg/django/core/management/templates.py", line 164, in handle if new_path.endswith(extensions) or filename in extra_files: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 22: ordinal not in range(128)

Maybe it's important: I had a serious issue with django-admin.py file (django installer didn't install it) but I found a following content of that file and maybe it's incorrect?

#!/usr/bin/env python
from django.core import management

if __name__ == "__main__":
    management.execute_from_command_line()

I was reading about that problem in Python 2.x but not in 3.x and I can't find the answer. Please, somebody help me with that.

Upvotes: 1

Views: 371

Answers (2)

Rafał M.
Rafał M.

Reputation: 31

It was a lack of openssh package in Cygwin. Make sure that you have it installed (I haven't)

Upvotes: 0

anatolii
anatolii

Reputation: 111

It seems to me, that Django is trying to start in Python verison 2.7. Try changing your default Python interpreter to python3 or python3.5.

Or at least you can try to change the first line of your django-admin.py to be: #!/usr/bin/env python3.5

Upvotes: 0

Related Questions