6

I have installed Git Bash, python 3.6 and Anaconda for the course which requires me to use Unix commands within Jupyter, such as !ls, !cat, !head etc. However, for each of these commands I get (e.g.):

'ls' is not recognized as an internal or external command, operable program or batch file.

I am using Windows 10. What can I do to be able to proceed with the course? Thanks!

7
  • 1
    Probably the easiest thing would be to just install some linux distro... Commented Aug 9, 2017 at 19:33
  • or install MSYS and put it in windows path Commented Aug 9, 2017 at 19:34
  • related: github.com/ipython/ipython/issues/8604 Looks like you don't have a lot of good options. Commented Aug 9, 2017 at 19:37
  • Thanks juanpa.arrivillaga, but I wouldn't want to be installing Linux for this... Commented Aug 9, 2017 at 19:43
  • 1
    just add the path of C:\msys64\usr\bin (if msys was installed there) Commented Aug 9, 2017 at 19:45

3 Answers 3

12

Please don't use !ls as mentioned in the course. Use %ls in the jupyter notebook and it works fine. Hope it helps.

Sign up to request clarification or add additional context in comments.

1 Comment

What's the name of this course?
3

If you are running Jupyter Notebook in Windows run conda install posix.

It worked for me.

Comments

1

A way to be able to use Unix commands on Windows is to install MSYS.

Once installed, to be able to use the commands from any Windows / python prompt, supposing that MSYS is installed in C:\msys64 (if you let default path untouched), add the following directory to user or system path:

C:\msys64\usr\bin

2 Comments

Git for Windows should have the MSYS binaries in its usr\bin directory.
probably, makes sense. This method is only a workaround when you did a botched/partial install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.