#31716: django-admin runserver mostly does not work on Windows
---------------------------------------------+------------------------
Reporter: Christian Ullrich | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
I frequently encounter the problem that running "django-admin runserver"
on Windows fails:
{{{
<some-venv>\scripts\python.exe: can't open file '<some-venv>\test\Scripts
\django-admin': [Errno 2] No such file or directory
}}}
The command works if run with --noreload.
There are probably other conditions that must be met for it to fail, or
work. I *think* it makes a difference, for example, if Django was
installed with pip or setuptools. The .exe "console scripts " are
different between the two; one type has a bit of readable Python at the
end, the other does not.
What I do know is that the problem is either caused or enabled by the
generated console scripts (the .exe wrappers in venv/Scripts) stripping
the .exe extension from their own sys.argv[0] when passing that to Python
to run. If I sabotage this by changing the regex in the file itself (where
present), or by adding the extension again in utils/autoreload.py before
running the command line, it works fine.
To be honest, I have no idea whether this is a bug in Django, or pip, or
setuptools, or distutils, or something else entirely. I have spent the
last two days trying to figure out what exactly goes wrong, and where,
with little success. I'm reporting it here because Django is the only
place I could find where it is possible to kludge the code into working.
I'll be happy to take my business elsewhere if someone can point the way.
--
Ticket URL: <https://code.djangoproject.com/ticket/31716>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.a2d0dcd9ecf286f1039af3bf0e5fbd22%40djangoproject.com.