Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Git4Win & Nano setup instructions #447

Closed
wants to merge 2 commits into from

Conversation

ostueker
Copy link

From Git for Windows v2.15.1 on, the installer will include the nano editor.
That version is expected to be released in early December 2017.

This PR includes an updated step-by-step guide for the Git for Windows installer.
In the Text-editor section, references to the swc_installer have been removed,
as nano will have been automatically installed.

Pre-release Git4Win installers can be found here.

@pgmccann
Copy link
Contributor

It seems to have been released already - I encountered it running through setup earlier today.

@ostueker
Copy link
Author

@pgmccann You are right. It has been released ~2 hours ago.

I'll test and possibly update later today.

@ostueker
Copy link
Author

Yeah, they released just while I was filing the PR. ;-)

@pgmccann
Copy link
Contributor

Well, I can confirm it worked for me as described on Windows 7, selecting the nano editor option during installation. Haven't tried selecting something else and then switching.

@ostueker
Copy link
Author

In this release they included nano, but broke vim. ;-)

git-for-windows/git#1382

@rgaiacs
Copy link
Contributor

rgaiacs commented Nov 29, 2017

@ostueker Thanks for the pull request. Could you rebase your commits and update the pull request?

@k8hertweck @ChristinaLK @tracykteal When do you want to merge this?

From Git-for-Windows v2.15.1 on, the installer will include the nano editor.
That version is expected to be released in early December 2017.

Signed-off-by: Oliver Stueker <[email protected]>
@ostueker ostueker changed the title [WIP] update Git4Win & Nano setup instructions update Git4Win & Nano setup instructions Nov 30, 2017
@ostueker
Copy link
Author

@rgaiacs I've rebased the commits.

Also a new git4win has been released that fixes the vim again.

Copy link
Contributor

@rgaiacs rgaiacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change request to the pull request.

index.md Outdated
@@ -312,21 +312,31 @@ and our administrator may contact you if we need any extra information.</h4>
<li>Download the Git for Windows <a href="https://git-for-windows.github.io/">installer</a>.</li>
<li>Run the installer and follow the steps bellow:
<ol>
{% comment %} Git 2.8.2 Setup {% endcomment %}
{% comment %} Git 2.15.1(2) Setup {% endcomment %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use

Git for Windows >= 2.15.1(2), more info at https://github.com/git-for-windows/git/releases/

in this line comment?

index.md Outdated
@@ -461,19 +471,7 @@ and our administrator may contact you if we need any extra information.</h4>
<a href="https://www.youtube.com/watch?v=339AEqk9c-8">Video Tutorial</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This video will be out of dated. Probably need to remove the link.

Also more info at git4win installation.
Changes as requested by @rgaiacs in PR#447

Signed-off-by: Oliver Stueker <[email protected]>
@ostueker ostueker changed the title update Git4Win & Nano setup instructions [WIP] update Git4Win & Nano setup instructions Dec 4, 2017
@ostueker
Copy link
Author

ostueker commented Dec 4, 2017

Update: Don't merge just yet.

I think I've encountered some issues with this setup during a SWC workshop this weekend and need a bit more time to investigate. (Will update here.)

@ostueker
Copy link
Author

ostueker commented Dec 17, 2017

(cross-post on carpentries/conversations#11)

I have just confirmed that on a fresh installation on of Git-for-Windows v2.15.1.2 and Anaconda3 v5.0.1, neither the python.exe nor jupyter.exe (or jupyter-notebook.exe) are in the PATH.
Therefore one can't run Python scripts or start the notebook from Git Bash.

This can be addressed in several ways:

  • During the installation of Anaconda one can choose to add Anaconda to the PATH.
    However this option is not default and on selecting it results in a red warning show up, basically saying "Don't do that!".
    I don't know what is the rational of that, however I suspect it could cause problems when activating coda environments.
  • One could add a line export PATH="${HOME}/Anaconda3:${HOME}/Anaconda3/Scripts:$PATH" to ~/.bashrc. Doing it manually by workshop attendees could be error-prone and require a lot of debugging by helpers.
  • It seems that adding source $HOME/Anaconda3/Scripts/activate root to ~/.bashrc also has the desired effect of activating the Anaconda Python.
    This seems to be the cleanest solution but also nothing I would expect all workshop attendees to get right on their first day on the Shell.

Any suggestions?

@ChristinaLK
Copy link
Contributor

@ostueker in the past I'm pretty sure we assumed that people would click the box on the anaconda installer. That's definitely the "easiest" in that, if people do it, it just works. The main reason not to use that approach would be that it could bork up someone's pre-existing python install. Also, no matter what we recommend, there will be some people who don't click the box on the installer, so we should have a good plan "B" regardless. :P

But I don't really have any solutions. Is there a way to set this from the command line w/o editing a bashrc? That could be put into an etherpad at the start of a workshop and then send instructions after the workshop about how to add it permanently to a bashrc if people don't want to run it every time they want to use python.

@ostueker
Copy link
Author

Thanks for your input @ChristinaLK.
Of course this could also be done interactively any time you open a new shell.

I could also come up with a short shell script that appends the linesource $HOME/Anaconda3/Scripts/activate root to the .bashrc, It could even check if $HOME/Anaconda3/Scripts/activate exists at all or if an Anaconda python already is on the PATH and give feedback whether it was successful or not.

@rgaiacs
Copy link
Contributor

rgaiacs commented Dec 21, 2017

Hi @ostueker, Thanks for the comments.

I will not worry that Windows users can't call Anaconda from Git Bash. Please don't take this wrong. I'm not putting Windows users as second class learners. We are trying to avoid our own set of scripts and installer to have our workshop instructions to match as close as possible what learners would find if they searcher online for "install Python" or "install Anaconda" or "install Git" or "install R" and so on. If we want to provide a Bash shell with Python, R, Git, ... we should not use Git Bash and Anaconda but provide instructors for learners install https://www.cygwin.com/ and the tools we need. We already discuss this and we are not going to follow this path. I believe that novice learners are able to work with two different terminals/Windows (Git Bash and Anaconda prompt) for two different tasks. When they got more experience they can search for how to configure the correct PATH and maybe at that time Windows will have their Linux terminal working for everyone out of the box.

@ChristinaLK
Copy link
Contributor

@rgaiacs I've always assumed that people were opening jupyter / python from the same prompt that they used for bash/git.

That doesn't have to be the case, and I think the alternative you describe (using the Anaconda prompt to open python / jupyter) is a good fix that will work for everyone, but if that's what we recommend, that should be made clear in the instructions.

@rgaiacs
Copy link
Contributor

rgaiacs commented Dec 23, 2017

I've always assumed that people were opening jupyter / python from the same prompt that they used for bash/git.

If you are using a macOS or Linux machine it is probably true. If you are using a Windows machine probably you are using the short-cut on the Desktop or start menu that Anaconda created for you.

That doesn't have to be the case, and I think the alternative you describe (using the Anaconda prompt to open python / jupyter) is a good fix that will work for everyone, but if that's what we recommend, that should be made clear in the instructions.

Do you want to create a issue at the Python lesson for this?

@rgaiacs
Copy link
Contributor

rgaiacs commented Jan 11, 2018

Happy New Year fellows!

Is https://github.com/git-for-windows/git/releases/tag/v2.15.1.windows.2 good enough for us to use? If yes, when can we make the change?

@ostueker
Copy link
Author

ostueker commented Jan 11, 2018

Yes, that is good enough to use.

The fact that python is no longer callable from the Git Bash seems to be an issue with newer installers of Anaconda. I'd like to continue the discussion, how we can provide instructions to run python from the Git Bash but that doesn't have to be here.

In my SWC workshop in December, we ran into trouble when I wanted to cover command line programs (Lesson 10). Windows users couldn't run Python from Git Bash, so I told them to open Anaconda Prompt. There of course ls didn't work.
Writing Python scripts is a nice part which closes the circle and ties back in to the Bash lesson on the first day.

@ChristinaLK
Copy link
Contributor

agree with @ostueker -- we ran into that exact problem this week. Feel free to open another issue if this isn't already being discussed somewhere on workshop-template or in carpentries/conversations.

@ostueker ostueker changed the title [WIP] update Git4Win & Nano setup instructions update Git4Win & Nano setup instructions Jan 11, 2018
@rgaiacs
Copy link
Contributor

rgaiacs commented Jan 11, 2018

Yes, that is good enough to use.

Great. Can we have a plan to move it forward? Something like

(Draft) Plan to Drop Custom Installer

  • Send pull request to https://github.com/swcarpentry/workshop-template/ with the change (highlight that version X or higher is need)
  • Send pull request to Shell and Git lesson to fix any mention to the installer
  • Send pull request to Python and R lesson to fix any mention of bash interaction
  • Send pull request to https://github.com/swcarpentry/site with a blog post mentioning the previous pull requests and the date that we plan to merge those.
  • Send email to discuss list after blog post is online

The fact that python is no longer callable from the Git Bash seems to be an issue with newer installers of Anaconda.

I don't remember if it ever was. But I will believe if other instructors say it was. I believe that Anaconda (the company) is interested to resolve this so should we push this issue upstream?

@ostueker
Copy link
Author

The fact that python is no longer callable from the Git Bash seems to be an issue with newer installers of Anaconda.

I don't remember if it ever was. But I will believe if other instructors say it was. I believe that Anaconda (the company) is interested to resolve this so should we push this issue upstream?

Adding Anaconda Python to the PATH is a (non-default) option of the installer. When checking it, a warning below turns red to discourage it. As I mentioned in a previous comment, I don't know the details of that change.

This PR contains all that.

  • Send pull request to Shell and Git lesson to fix any mention to the installer

I'll hopefully reach to do that next week.

@mikej888
Copy link
Contributor

Git for Windows issues

I installed Git for Windows 2.15.1.2 64-bit just before Xmas. nano was fine but there were a couple of quirks, relating to the Configuring the terminal emulator to use with Git Bash options.

  • If I selected Use Windows default console window (recommended by SWC) then CTRL-A (start of line) did not work. Entering an incorrect SSH password when accessing a Git repository would cause subsequent command prompts to vanish.
  • If I selected MinTTY, then the above problems did not arise but running interactive environments (e.g. python, ipython, sqlite3) just hung. I had to add the following aliases to .bash_profile (these were suggested at https://stackoverflow.com/questions/32597209/python-not-working-in-the-command-line-of-git-bash):
alias python='winpty python.exe'
alias ipython='winpty ipython.exe'
alias sqlite3='winpty sqlite3.exe'

Using Anaconda from within Git Bash

Some instructors teach Python via the command-line, as that is more appropriate for certain audiences than Jupyter notebook.

@rgaiacs commented that:

I believe that novice learners are able to work with two different terminals/Windows (Git Bash and Anaconda prompt) for two different tasks.
When they got more experience they can search for how to configure the correct PATH and maybe at that time Windows will have their Linux terminal working for everyone out of the box.

While this unfortunately means learners aren't using the same terminal window for everything, I'd agree that it's a good idea for ensuring learners aren't stuck in configuration/installation issues. As an alternative to them searching for how to configure the PATH, a page of advice could be written for them.

SWC installer

The SWC installer is still required for downloading "sqlite3" and "make" for those lessons. There are still SWC installer references on the workshop-template, index.md, page to which this pull request relates, under "SQLite3".

@iglpdc
Copy link
Contributor

iglpdc commented Jan 12, 2018

In my SWC workshop in December, we ran into trouble when I wanted to cover command line programs (Lesson 10). Windows users couldn't run Python from Git Bash, so I told them to open Anaconda Prompt. There of course ls didn't work.
Writing Python scripts is a nice part which closes the circle and ties back in to the Bash lesson on the first day.

Couldn't we use the terminal included in the Jupyter notebook to do that? Windows users will have to start the jupyter notebook from the Anaconda prompt, but only at the beginning of the lesson. To run the scripts in the latter part of the lesson, all learners would open a new terminal from the Jupyter notebook which has a fully featured terminal with bash.

It's not ideal, but may work while the issues are being fixed. Also using the terminal from Jupyter could be documented in the instructor guide as a quick fix for a broken installation.

@iglpdc
Copy link
Contributor

iglpdc commented Jan 12, 2018

Send pull request to https://github.com/swcarpentry/workshop-template/ with the change (highlight that version X or higher is need)
Send pull request to Shell and Git lesson to fix any mention to the installer

The setup section in the Git lesson directs you to the workshop template instructors, so there is nothing to do.

@rgaiacs
Copy link
Contributor

rgaiacs commented Jan 12, 2018

To run the scripts in the latter part of the lesson, all learners would open a new terminal from the Jupyter notebook which has a fully featured terminal with bash.

Last time that I tested install Anaconda in Windows, it didn't install Bash and because of that the Bash terminal in Jupyter wasn't available.

@rgaiacs
Copy link
Contributor

rgaiacs commented Feb 16, 2018

@ostueker Thanks for this pull request. Now that @fmichonneau is on board as a staff member he told me that he could devote some time to push this forward. He asked me for instructions as a plan and I provided at carpentries/lesson-infrastructure#4.

@tmorrell
Copy link
Contributor

tmorrell commented Aug 9, 2018

Was there any decision on the best installation instructions for Windows? This also ties into #520 and #521. I'm teaching a workshop next week so I might just have to figure this out myself.

@tracykteal
Copy link
Contributor

Yes, installation instructions have been updated and are reflected in the recent workshop template https://github.com/carpentries/workshop-template/. We use Git for Windows now. I do have a PR in that removes a reference to the SWC installer in the text editor section. #521

@tmorrell
Copy link
Contributor

tmorrell commented Aug 9, 2018

@tracykteal These updates were never merged. I've just created a new PR that collects all the changes to match the current Windows Git installer.

@tracykteal
Copy link
Contributor

I see. Thanks a lot for the PR.

@tmorrell
Copy link
Contributor

tmorrell commented Aug 9, 2018

I think the PR can now be closed, because the changes were merged in #525

@tracykteal
Copy link
Contributor

OK, closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants