Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Web Applications with Flask

You're reading from   Building Web Applications with Flask Use Python and Flask to build amazing web applications, just the way you want them!

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781784396152
Length 160 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Setting up a virtual environment

A virtual environment is the way Python isolates full package environments from one another. This means you can easily manage dependencies. Imagine you want to define the minimum necessary packages for a project; a virtual environment would be perfect to let you test and export the list of needed packages. We will discuss it later on. Now, create a new terminal pressing Ctrl + Shift + T on your keyboard and create our hello world environment like this:

mkvirtualenv hello
pip install flask

The first line creates our environment with the name "hello". You will also automatically load that environment into the current terminal. You can deactivate your virtual environment by typing deactivate and you can load it again with the following command:

workon hello  # substitute hello with the desired environment name if needed

The second line tells pip to install the Flask package in the current virtual environment, hello in this case.

You have been reading a chapter from
Building Web Applications with Flask
Published in: Jun 2015
Publisher:
ISBN-13: 9781784396152
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image