0% found this document useful (0 votes)
34 views

Practice 05 Installing Python With Anaconda

This document outlines the steps for students to set up Python 3.6 with Flask using Anaconda on Ubuntu. It includes instructions for installing Anaconda, creating a virtual environment, installing Flask, and testing a simple Flask application. Students are required to submit screenshots of their virtual environment and the running Flask app as part of their assignment.

Uploaded by

Melvin Zambrano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Practice 05 Installing Python With Anaconda

This document outlines the steps for students to set up Python 3.6 with Flask using Anaconda on Ubuntu. It includes instructions for installing Anaconda, creating a virtual environment, installing Flask, and testing a simple Flask application. Students are required to submit screenshots of their virtual environment and the running Flask app as part of their assignment.

Uploaded by

Melvin Zambrano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Activity: Setting Up Python 3.

6 with Flask Using Anaconda on Ubuntu

Objective:
Students will learn to install Anaconda, create a virtual environment, and configure it with
Python 3.6 and Flask on Linux Ubuntu.

Steps for the Activity

Part 1: Install Anaconda

1. Download Anaconda:

o Open the terminal and run the following command to download the latest
Anaconda installer:

wget https://repo.anaconda.com/archive/Anaconda3-2023.11-Linux-x86_64.sh

o (Replace the version if a newer one is available.)

2. Install Anaconda:

o Run the installer script:

bash Anaconda3-2023.11-Linux-x86_64.sh

o Follow the prompts and accept the license terms. Confirm the installation
path (default is recommended).

3. Initialize Anaconda:

o After installation, initialize Anaconda:

source ~/.bashrc

conda init

o Restart the terminal to apply changes.

Part 2: Create a Virtual Environment

1. Create a New Environment with Python 3.6:

o In the terminal, run:

conda create --name flask_env python=3.6

o This command creates a virtual environment named flask_env with Python


3.6.

2. Activate the Environment:

o Run the following command to activate the environment:

conda activate flask_env


Part 3: Install Flask

1. Install Flask in the Environment:

o While in the flask_env environment, install Flask using pip:

pip install flask

2. Verify Installation:

o Confirm Flask is installed:

python -m flask --version

Part 4: Test Flask

1. Create a Simple Flask App:

o In the terminal, create a file called app.py:

code app.py

o Add the following code:

from flask import Flask

app = Flask(__name__)

@app.route('/')

def home():

return "Hello, Flask!"

if __name__ == "__main__":

app.run(debug=True)

2. Run the Flask App:

o Start the Flask application:

python app.py

o Open a browser and go to http://127.0.0.1:5000 to see the message:


"Hello, Flask!"

Submission Requirements

• Students must submit:

o A screenshot of their virtual environment setup (conda list).

o A screenshot of the browser showing the Flask app running.

By: Ing. César Sinchiguano, M.Sc

You might also like