Waylan is correct, but does not go far enough.

When one installs Python 3.3, the Python Launcher for Windows is also 
installed. I install Python 3 even on systems where I do not (at present) 
plan to use it, just to get the launcher. The launcher is the program which 
should be associated with .py files on Windows. It is responsible for 
reading the #! line at the top of your Python file and running the correct 
version of Python. The launcher works so well at handling different 
versions that I keep wanting to install it on my Linux boxes as well.

So, I would agree that the Windows installation instructions might indeed 
be altered -- to include installing Python 3.3 (or later), and associating 
the c:\windows\py.exe with .py files.

If you plan to use only a single version of Python, putting that directory 
(and its "scripts" directory) in your PATH is a good idea. But, I feel that 
virtualenvwrapper-win <https://pypi.python.org/pypi/virtualenvwrapper-win>is 
the best way to go.  It works almost exactly like virtualenvwrapper for 
Linux, and if used with PyCharm 3.0 one can almost forget which OS one is 
using.

I am going to investigate using the launcher to pick the correct 
virtualenv.  Meanwhile -1 on the patch.

a
On Sunday, November , 2013 4:58:49 PM UTC-7, waylan wrote:
>
>
>
> On Sunday, November 24, 2013, Rémi Rampin wrote:
>
>> Hi developers,
>>
>> On Windows, running the django-admin.py tool is painful[1], because
>> .py scripts are not "executable". You might be able to run it using
>> the full path (if Python is the default handler for .py files, which
>> it really shouldn't be). Most probably you'll need to copy it to your
>> project directory and prefix it with "python " each time.
>
>
> There are a few things I do whenever I install python on windows.
>
> 1) first, make sure the .py extension is associated with python.exe.
> 2) add the python directory to my path.
> 3) add the scripts directory to my path.
>
> Then, when any packages install scripts (like django-admin.py), they ‘just 
> work’.
>
> If you have multiple versions on python installed, then you can copy 
> python.exe to pythonX.X.exe and make sure the defult version (the version 
> associated with .py) is listed first on your path. The order of dirs on 
> your path in key here, but you can list all the versions on your path. Then 
> you can just type `python3.3` for example, and you'll get that version just 
> like on unix systems.
>
> Of course, on unix based systems we all use virtualenv. There are a few 
> windows virtualenv clones implemented for windows either as batch scripts 
> or powershell scripts. You might want to look into those. Although, I 
> haven't used them myself, so I can't speak to their completeness, 
> reliability or usefulness. I always have git installed which comes with 
> mssys and gives me a bash shell on windows - the best solution IMO 
> (although virtualenv can be a little janky).
>
> Of course, this has entered django-users territory. And additional 
> discussion about how to work around windows limitations should probably be 
> discussed there. My point is that with a correctly configured system, this 
> is not a problem on windows at all.
>
> If there are any changes to make to Django, perhaps the install docs could 
> suggest the additions to the path I mention about as specific to installing 
> on windows.
>
>
> -- 
> Waylan Limberg
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c1df7c13-684e-4c8c-9fe6-3c169b089645%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to