# Getting Started with Python

Python is fully supported on VM Sandboxes and Repositories. It leverages [Docker](/content/docs/tutorial/getting-started-with-docker/index.html) to run a configurable Python container, while also bringing IntelliSense and support for Python package managers.

In this tutorial, we will showcase two different approaches you can use to get started with Python in CodeSandbox: starting from a template or importing an existing Python project.

## Starting from a template [Permalink for this section](/content/docs/tutorial/getting-started-with-python#starting-from-a-template/index.html)

CodeSandbox provides a growing collection of Python templates that may be useful depending on your use case.

In case you want a fresh, blank environment to start building a project from scratch, you can use our [Python starter (opens in a new tab)](/content/p/sandbox/python-starter-in2qez/index.html). Otherwise, you will find our existing Python templates in the "Python" tab of the [template library (opens in a new tab)](/content/d/index.html).

After forking one of these templates, you will probably want to open a [terminal](/content/docs/learn/repositories/terminal/index.html) (which you can find under DevTools, on the top right) to run `python` commands.

## Importing an existing repository [Permalink for this section](/content/docs/tutorial/getting-started-with-python#importing-an-existing-repository/index.html)

You can also import one of your existing Python repositories from GitHub into CodeSandbox by following the steps below.

### 1. Import repository [Permalink for this section](/content/docs/tutorial/getting-started-with-python#1-import-repository/index.html)

From the CodeSandbox dashboard, click "Import from GitHub" and input the URL of your repository. If you are missing the required permissions, you should get a prompt asking you to update them.

💡

You can also type your repo without GitHub URL (e.g. “codesandbox/test-sandbox”) to import the repo.

### 2. Rebuild the container [Permalink for this section](/content/docs/tutorial/getting-started-with-python#2-rebuild-the-container/index.html)

As mentioned above, CodeSandbox relies on a Dockerfile to run Python.

After importing your repository, you won't be able to immediately run `python` commands. First, you need to rebuild the container.

To do that, open any `.py` file and you will see a prompt appear, asking if you want to create a Dockerfile. Click "Create Dockerfile".

CodeSandbox will create this file and set up Python. The first time when you do this step, it can take a while. However, after this setup, we will create a memory snapshot of the VM, which will ensure that the following VM loads (& clones!) will be fast.

### 3. Use the container [Permalink for this section](/content/docs/tutorial/getting-started-with-python#3-use-the-container/index.html)

Now that the container has been built, all your new terminal sessions will be executed from inside this container, which is running Python. You can test this by opening a new [terminal](/content/docs/learn/repositories/terminal/index.html), and verifying that `python` is installed.

[Install CLI tools and global modules](/content/docs/tutorial/cli-tool "Install CLI tools and global modules"/index.html) [Getting started with PHP](/content/docs/tutorial/getting-started-with-php "Getting started with PHP"/index.html)
