So you wanna code? (Getting started with Python in Anaconda)

Harshit Lahoti
3 min readMay 16, 2021

Me and more intensely my friend have tried our hands quite a few times at coding. However, its a bottomless pit of too many jargons and throwing off errors out there. Here is an attempt to navigate you through all this, from a beginner’s POV —

Photo by Susan Q Yin on Unsplash

0. We will attempt to install Python, it is a great language to begin with, and can be used for machine learning, deep learning, etc.

1. Install Anaconda (Anaconda | Individual Edition)- it’s an easy way to get started in Python, create virtual environments, etc. Finish the installation.

2. Open Anaconda Navigator. Go to Environments in the left pane > Create in the bottom pane. This will create a virtual environment, which is basically a wrapper inside which whatever you do stays- in case you mess up, your machine remains safe.

3. Next, go to the right pane, click Installed, and search for “pip” to see if it is installed. If you can’t find it, select Not Installed from the drop down and then search, select and click Apply at the bottom right.

4. Next, go Home tab > Applications on- your environment’s name (nlu in this case) > Launch Jupyter Notebook

5. Your browser will open, with your home directory (aka the most meta folder of your system, which includes everything else) by default. For starters, you can go to New > Python 3 Notebook, or navigate to a preferred folder (say, Desktop) and then create a notebook there.

6. This is how your notebook would look like. Each box is a cell, where you can enter your code.
To create a new cell, click the plus sign (1) or hit Shift + Enter.
To run the code in the cell, hit Command(Control for Windows)+ Enter, or click Run (2).
When you install a program, it would tell you to restart the kernel- you can do that by clicking Kernel (3) > Restart.

7. To install any tool, either go the earlier way of Home tab > Not Installed > search for the tool, or you can use the pip tool directly from the notebook. For instance, let us load Cmake, which would help in a face recognition project. Type the following in a new cell: pip install cmake
Click on Run. Hopefully it would load in a while without any errors. Write any errors in the comments below, or self-help using Google! For the tool to apply, click on Kernel > Restart.

That’s it. You’re set up, now you can begin your journey!

--

--