A
A
Anton2016-10-23 10:11:52
Django
Anton, 2016-10-23 10:11:52

Why do I get a UnicodeEncodeError when I try to start the Django server from under a virtual environment?

Running manage.py runserver in virtualenv results in this:

Traceback (most recent call last):
  File "C:\Users\Антон\Documents\Python\projects\mysite\manage.py", line 22, in <module> execute_from_command_line(sys.argv)
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line utility.execute()
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\base.py", line 294, in run_from_argv self.execute(*args, **cmd_options)
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\commands\runserver.py", line 58, in execute super(Command, self).execute(*args, **options)
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\base.py", line 345, in execute output = self.handle(*args, **options)
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\commands\runserver.py", line 97, in handle self.run(**options)
  File "c:\program files (x86)\python\lib\site-packages\django\core\management\commands\runserver.py", line 106, in run autoreload.main(self.inner_run, None, options)
  File "c:\program files (x86)\python\lib\site-packages\django\utils\autoreload.py", line 333, in main reloader(wrapped_main_func, args, kwargs)
  File "c:\program files (x86)\python\lib\site-packages\django\utils\autoreload.py", line 304, in python_reloader exit_code = restart_with_reloader()
  File "c:\program files (x86)\python\lib\site-packages\django\utils\autoreload.py", line 290, in restart_with_reloader exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character

Who can explain what the problem is and how to solve it?
Outside the virtual environment, the server is started .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2016-10-23
@Gambetto

C:\Users\Anton\
remove Cyrillic from path
Remove Cyrillic from PC name
or
Do not use Windows / not posix OS

Z
zelsky, 2016-10-23
@zelsky

# -*- coding: utf-8 -*- or use \\ instead of \

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question