Python Programming : A Classroom Approach.
1.4
Installing Code Editors
Let’s get Jupyter Notebook
installed on your computers. I’ll walk you through the steps for both Windows
and Linux.
1.4.1 Installing Jupyter Notebook:
On Windows :
Before we begin, make sure you have Python installed.
If not, please refer to the previous instructions on installing Python first,
and ensure that you checked the box that says "Add Python to PATH"
during the installation process.
Open Command Prompt:
Search for "Command Prompt" in the Start menu
and open it.
Install Jupyter Notebook using pip:
Type the following command and press Enter:
pip
install notebook
This command uses pip, the package installer for
Python, to download and install Jupyter Notebook and
its dependencies.
Wait for Installation:
The installation process may take a few minutes,
depending on your internet speed. Once it’s done, you’ll see a message saying
that Jupyter Notebook was successfully installed.
Run Jupyter Notebook:
Type the following command and press Enter:
jupyter notebook
This will start the Jupyter
Notebook server and open Jupyter Notebook in your
default web browser. It’s also possible to install the classic Jupyter Notebook interface.
Using Jupyter Notebook:
Jupyter Notebook
should open in your web browser. If it doesn’t open automatically, copy and
paste the URL from the command prompt into your browser.
From here, you can create new notebooks, open existing
ones, and start writing and running code.
Linux (Debian/Ubuntu)
Open Terminal:
Search for "Terminal" in the application
menu and open it.
Update Package List:
Type the following command and press Enter:
sudo apt update
This command updates the list of available packages
from the repositories. You’ll be prompted for your password.
Install pip:
If you don’t have pip installed, type the following
command and press Enter:
sudo apt install python3-pip
This command installs pip, the package installer for
Python 3.
Install Jupyter Notebook using pip:
Type the following command and press Enter:
pip3
install notebook
This command uses pip3 to download and install Jupyter Notebook and its dependencies.
Run Jupyter Notebook:
Type the following command and press Enter:
jupyter notebook
This will start the Jupyter
Notebook server and open Jupyter Notebook in your default
web browser.
Using Jupyter Notebook:
Jupyter Notebook
should open in your web browser. If it doesn’t open automatically, copy and
paste the URL from the terminal into your browser.
From here, you can create new notebooks, open existing
ones, and start writing and running code.
1.4.2 Installing PyCharm:
i.
Download
PyCharm:
Ø Go to the JetBrains website (https://www.jetbrains.com/pycharm/download/).
Ø Choose the
appropriate version for your operating system.
Ø You’ll see
two options: Professional and Community. The Professional version is a paid
version with more features, while the Community version is free and open-source
For learning Python, the Community version is usually
sufficient.
ii.
Run
the Installer:
Once the download is
complete, run the installer.
Follow the on-screen
instructions.
iii.
Installation
Options:
During installation, you may be presented with several
options:
Ø Create Desktop Shortcut: Check this
box to create a shortcut on your desktop for easy access.
Ø Update PATH variable: This
option adds PyCharm’s directory to your system’s PATH
variable, allowing you to run PyCharm from the
command line.
Ø Associate .py files: This
option associates .py files with PyCharm,
so they automatically open in PyCharm when you
double-click them.
Ø Create associations: Choose the file types you
want to associate with PyCharm (e.g., .py).
iv.
Complete
the Installation:
Ø After
selecting the desired options, click "Install" to begin the
installation process.
Ø Once the
installation is complete, you may be prompted to restart your computer.
After installation, you can customize the UI.