I’ve noticed that certain commands in the Jupyter notebooks fail unless you stick a “!” in front of them, and I have no clear intuition why. I’ve tried Googling this to no avail and I haven’t encountered this syntax in Python programming either.
Here’s an example from the Lesson 3 Planets notebook:
The following command:
mkdir -p ~/.kaggle/
results in the following error:
File “”, line 1
mkdir -p ~/.kaggle/
^
SyntaxError: invalid syntax
On the other hand, the modified command succeeds:
! mkdir -p ~/.kaggle/
The same is true for other commands like
! mv kaggle.json ~/.kaggle/
and
! kaggle competitions download -c planet-understanding-the-amazon-from-space -f train-jpg.tar.7z -p {path}