I have a google colab file that I want to run in Visual Studio Code. Normal cells are running ok but I have the following cell:
# 1. Downloads, extracts, and sets the permissions for the Elasticsearch installation image:
%%bash
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.2-linux-x86_64.tar.gz -q
tar -xzf elasticsearch-7.9.2-linux-x86_64.tar.gz
chown -R daemon:daemon elasticsearch-7.9.2
The problem is that I am getting SyntaxError: invalid syntax
on the wget
I have tried multiple solutions from stackoverflow
- Use the generic
%%bash
I use in Google Colab too. - Use
%%shell
- Use the longer version of 1,
%%script bash
- Use
%%script
bash - Use the shortcut
%%!
2
Answers
Ok I found the solution by myself
This is the correct syntax
Could you run this in the VS Code terminal instead?
Mac / Linux
Windows