Environment Setup
Pre-requisisites
These steps work are intended for Mac users but should work for Windows with very little change. The only pre-requisites are:
- Download and install python
- Download here : https://www.python.org/downloads/
- When you install make sure that it updates your PATH variable and also installs pip
- Download and install Visual Studio Code
- Download from here: https://visualstudio.microsoft.com/downloads/
- Make sure to download Visual Studio Code (which at the time of writing was second on the list)
- Optional : Install Github and create a Github account
Post-Installation setup
Create a python virtual environmentI tend to do this from a command line but you can also do the same in VSStudio 1. Open a terminal in mac 2. make a directory where you want to write your code (e.g ~/dev/python/ml-projects) 3. cd to that project directory 4. Create a virtual environment called ‘.venv’ in your directory (the ‘%’ sign beow refers to the command prompt) % python3 -m venv .venv 5. Activate the einvronment % source .venv/bin/activate 6. Install python libraries - the list below is a good start: % pip install numpy matplotlib ipykernel
vscode setupYou will need to install some add-ons into vscode, but when you create a python notebook it will usually prompt you - Start vscdoe - Open the folder you created in step 2 above - Create a new notebook file e.g. test.ipynb - vscode should prompt you to select a kernel (top right of vscode) - When it does so, click on the message and from the dropdown select ‘Python’ - You should see the .venv folder you created in step 4 above listed - select that - If you need toadd more libraries, I prefer to do that from the command prompt using pip (step 5 and 6 above)