Python Development Environment
Python Development Environment
This tutorial shows how to prepare your local machine for Python development,
including developing Python apps that run on Google Cloud Platform (GCP).
Objectives
To install pip with Python 2 or Python 3, use pip install --upgrade virtualenv.
2- After you install virtualenv, you can create a virtual environment in your project.
virtualenv creates a virtual copy of the entire Python installation in the env folder.
Use the --python flag to tell virtualenv which Python version to use:
cd your-project
You might need to specify the full path to the Python installation directory:
3- After the copy is created, set your shell to use the virtualenv paths for Python by
activating the virtual environment as follows.
.\env\Scripts\activate
4- Now you can install packages without affecting other projects or your global Python
installation:
If you want to stop using the virtual environment and go back to your global Python, you
can deactivate it:
deactivate
Installing an editor
To develop Python apps, you need an editor. Here are a few of the more popular
editors :
- Atom by GitHub
- PyCharm by JetBrains
The Cloud SDK is a set of tools for Google Cloud Platform (GCP). It contains gcloud, gsutil,
and bq, which you can use to access Compute Engine, Cloud Storage, BigQuery, and
other products and services from the command line. You can run these tools
interactively or in your automated scripts.
The Cloud Client Libraries for Python is how Python developers integrate with GCP
services like Cloud Datastore and Cloud Storage. To install the package for an individual
API like Cloud Storage, use a command similar to the following: