tutorial icon indicating copy to clipboard operation
tutorial copied to clipboard

suggestion: install git on windows first, then use git bash -- minimises windows/unix differences

Open hjwp opened this issue 10 years ago • 8 comments

For my book, I suggest Windows people install Git right upfront. That gives them git-bash, which looks a lot more like the bashes on linux or mac. So then, no need to do windows explanations separately, whomai, pwd, dir, all "just work", as do forward-slashes for paths, etc etc...

just a suggestion. although it will simplify lots of parts of the tutorial, where you no longer need to have special windows instructions, it does force people to install software really early on in the tutorial (in the command line intro section).

let me know if y'all like the sound of this and i'll prepare a pull request.

hjwp avatar Apr 04 '15 13:04 hjwp

+1

Back in my learner days on windows this was my strategy.

I wonder if anything has changed in the intervening years (I imagine git-bash/msysgit is just better quality) or if there's any good reason against this.


Elena :) @elequ

On Sun, Apr 5, 2015 at 12:55 AM, Harry Percival [email protected] wrote:

For my book, I suggest Windows people install Git right upfront. That gives them git-bash, which looks a lot more like the bashes on linux or mac. So then, no need to do windows explanations separately, whomai, pwd, dir, all "just work", as do forward-slashes for paths, etc etc...

just a suggestion. although it will simplify lots of parts of the tutorial, where you no longer need to have special windows instructions, it does force people to install software really early on in the tutorial (in the command line intro section).

let me know if y'all like the sound of this and i'll prepare a pull request.

— Reply to this email directly or view it on GitHub https://github.com/DjangoGirls/tutorial/issues/314.

elena avatar Apr 08 '15 10:04 elena

So far in my investigations, the only downsides i've found of git-bash are:

  • python3 -m venv doesn't produce a bash-compatible activate script on windows, so it doesn't really work. cf http://bugs.python.org/issue22343
  • virtualenv works fine
  • virtualenvwrapper needs the user to install an extra binary, 'mktemp', which in turn requires the user to uncompress a .tar.lzma file. not good. so virtualenvwrapper is probaably out, for now. https://bitbucket.org/dhellmann/virtualenvwrapper/issue/264/support-git-bash-bundled-with-git-on

other than that, git-bash is pretty good. it's less of a mess / kitchen-sink than cygwin, but it does most unixey stuff, without trying to pretend to replace windows. In that respect it's than babun because it works with the system-installed pythons, rather than trying to install its own separate ones, so it's compatible with IDEs like pycharm. babun does look really really cool, but there's that problem, plus python3.4 isn't bundled yet...

So, yeah, git-bash looks pretty good. i think it would allow us to remove pretty much all the "on windows do this, on mac/linux do that" bits...

I don't know anything about anaconda, before anyone asks.

hjwp avatar Apr 08 '15 18:04 hjwp

There is also #277 that is somewhat related to this topic. The cmder package has msysgit and standard POSIX commands included. I had no time to check it throughly but it requires to install one package only and seems to solve the Windows command line problem :).

aniav avatar Apr 09 '15 11:04 aniav

Now that students are already installing Git for deployment, it might be a good time to bring this up again. In my experience, using Git Bash is much nicer than the Windows terminal.

I've been checking on Windows 7 and the first issue with python -m venv is quite easy to fix manually. It's not ideal, of course, but it just involves copying the activate file from C:\Python34\Lib\venv\scripts\posix to C:\Python34\Lib\venv\scripts\nt. It's a one-time step and it will probably be fixed in Python 3.5 anyway.

Then, activating the virtualenv from Git Bash would look like this:

lhernandezu@LHERNANDEZU01W7 /d/Proyectos/Python/test
$ source myenv/Scripts/activate

lhuriguen avatar Jun 23 '15 07:06 lhuriguen

for info y'all, i am revisiting git-bash, virtualenvwrapper etc for my own tutorial, and i find that python -m venv now actually works just fine if you have Python 3.6.3 or later, so that removes one hurdle.

am changing my own installation instructions, and i'll let y'all know if it goes well and readers seem to like it...

hjwp avatar Nov 16 '17 13:11 hjwp

The idea is still nice. Any progress on this?

ekohl avatar Nov 17 '18 11:11 ekohl

The idea is still nice. Any progress on this?

I guess by "[his] own tutorial", @hjwp meant his book "Test-Driven Web Development with Python" that is freely available to read online on http://www.obeythetestinggoat.com/ (Thanks for that, Harry!)

And indeed he now recommends Git-Bash for Windows users, there. He also instructs how to use virtualenv in it and what to do if that doesn't work. (See the "Activate Not Working on Windows?" info box.)

das-g avatar Nov 17 '18 11:11 das-g

git-bash is still working well for me. if i find some time i will start on a PR for this, but not sure if i will have time in the near future. if anyone else wants to make a start, feel free to copy-paste anything you like from my book's installation instructions chapter...

hjwp avatar Nov 19 '18 06:11 hjwp