P. Prunesquallor
P. Prunesquallor

Reputation: 571

Python - Unix commands not recognized in Jupyter

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!

Upvotes: 6

Views: 10053

Answers (3)

Ananth Subramanian
Ananth Subramanian

Reputation: 69

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

It worked for me.

Upvotes: 3

user2877969
user2877969

Reputation: 149

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

Upvotes: 12

Jean-François Fabre
Jean-François Fabre

Reputation: 140196

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

Upvotes: 1

Related Questions