1

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)

  • I am running this command in Cygwin 6.3
  • Python version: 3.5.2
  • Django version: 1.10.2

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.

2
  • It is without dot. django-admin startproject mysite . > django-admin startproject mysite Commented Nov 5, 2016 at 19:12
  • You are also using the Python 2 installed Django. The Django you use lives in py2.7.egg. Just create an env and start your project from there. Eg: virtualenv -p python3 env, env/bin/pip install django and env/bin/startproject mystie. Commented Nov 5, 2016 at 19:17

2 Answers 2

0

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

Sign up to request clarification or add additional context in comments.

2 Comments

I checked my PATH environment variable and I have there " C:\Python35\Scripts\;C:\Python35\;C:\Python35\Lib\site-packages\Django-1.10.2-py3.5.egg\django\bin " and I think it seems correctly. Is that a way to set a default Python interpreter or not? Second advice didn't working :/
@RafałM., but the exception you provided tells, that it's actually a "Django-1.10.2-py2.7.egg/..."
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.