2. VS Code Setup
VS Code is a source code editor that is useful for writing and debugging code. For Xprize, we shall use it as the platform to run some of the Machine Learning (ML) Classifiers.
Installation of VS Code
To download VS Code, go to the official website and download the appropriate version for your OS platform.
Once downloaded, double click it to install the editor on your OS.
Integrating WSL2 and VS Code
If running a Windows laptop, one can launch VS Code from the WSL2 terminal. This will be the preferred approach for launching VS Code from our Ubuntu folder that comes with WSL2 installation.
Go to the searchbar and type wsl
. An icon similar to a penguin and with a bluish background will appear. Click on it.
A terminal will appear, like below:
The above terminal contains the username, in this case sammigachuhi
and the values after @, that is gachuhi
refers to the name of your laptop account.
The path to the Ubuntu folder in which WSL2 runs on is Ubuntu\home\<username-provided-during-ubuntu-installation
. eg Ubuntu\home\sammigachuhi
where sammigachuhi
is the root folder where WSL2 operates from.
Type ls
within the terminal. This will list the folders within your Ubuntu folder. In my case I have three: github4
, mygithub
and snap
. However, in case you are starting from a clean slate, you may have to create a folder using the mkdir
command.
Therefore, assuming we want to start from ground zero, let’s create a new folder called xprize
using the WSL2 terminal.
To create a new folder use the mkdir
command followed by the name of the folder. For example, to create the xprize
folder, we will type in:
mkdir xprize/
Congratulations! You have created your first folder inside Ubuntu entirely using code!
Type, ls
and you will see your xprize
folder as part of the list in case you had other folders already existing.
To go into the xprize folder, type cd <name-of-folder>
in this case xprize
. You now get the gist. A command, such as cd
or mkdir
is followed by an argument. To get into xprize
folder, type:
cd xprize/
Then to launch VS Code from within this folder, type code .
Note the dot (.)!
Your VS Code should launch immediately. Note that in the top left, which is the Explorer tab, it shows the xprize
folder from which VS Code is running in. The terminal should also display the same. Finally, the terminal we will be using is known as bash
. Some computers use zsh
but for windows it is bash
. Bash is a text based user interface system for interacting with your OS.