> For the complete documentation index, see [llms.txt](https://docs.trymito.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trymito.io/how-to/creating-a-mitosheet.md).

# Creating a Mitosheet

Use Mito to generate Python code, start automating your Excel processes.

{% hint style="warning" %}
Before creating a Mitosheet, make sure [you've installed Mito](/getting-started/installing-mito.md). If you just installed Mito, **make sure to restart your kernel + refresh your browser.**
{% endhint %}

### Create a new mitosheet

1. Open the Notebook where you want to create the mitosheet. If you installed Mito in a virutal environment, make sure to [launch the notebook from the same virtual environment](/how-to/creating-a-mitosheet/open-existing-virtual-environments.md).&#x20;
2. Copy and paste this code into a cell:

```python
import mitosheet
mitosheet.sheet()
```

3. Run the code by clicking on the code cell that contains it and pressing **Shift + Enter**.
4. Follow the instructions to [import data into Mito](/how-to/importing-data-to-mito.md).

### Reopen an existing mitosheet

If you've already created a mitosheet that you want to continue working from:

1. Open the Notebook where you previously created the mitosheet. If you installed Mito in a virutal environment, make sure to [launch the notebook from the same virtual environment](/how-to/creating-a-mitosheet/open-existing-virtual-environments.md).&#x20;
2. Click on the code cell that contains the `mitosheet.sheet(...)` call that you want to reload, and press **Shift+Enter**.

If you want to learn more about reopening an existing mitosheet, read [this section](/how-to/overview-of-the-mitosheet.md#rerunning-an-analysis) of the Core Concepts overview. &#x20;

### Common Errors

#### First time creating a mitosheet

If this is the first mitosheet you are creating after installing Mito, view these [common install errors](/getting-started/installing-mito/common-install-errors.md).

#### ModuleNotFoundError

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FeJzhjr67gf6EKgkGDZJJ%2FScreenshot%202023-09-26%20at%202.02.39%20PM.png?alt=media&amp;token=e7bb8f10-4861-4532-8b56-76f7aff7fc65" alt=""><figcaption></figcaption></figure>

If you've previously created a mitosheet, and you see this **ModuleNotFoundError** after running the above code, its likely because the mitosheet package is not installed in your current environment.&#x20;

Make sure to launch [launch the notebook from the same virtual environment](/how-to/creating-a-mitosheet/open-existing-virtual-environments.md) that you installed Mito in.&#x20;

**NameError**

<figure><img src="https://2294704369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP_U5ZCmiamDOXEOOTC%2Fuploads%2FgTnW934T52bwWJV6T1Ew%2FScreenshot%202023-09-26%20at%202.02.52%20PM.png?alt=media&amp;token=4b68e5f1-edbf-4b39-b35b-441b2404a625" alt=""><figcaption></figcaption></figure>

If after running the `mitosheet.sheet()` code, you see this **NameError**, you have to first import the mitosheet package.&#x20;

1. Copy this code into your notebook above the `mitosheet.sheet()` call

```
import mitosheet
```

2. Click on the `import mitosheet` code and press **Shift + Enter**&#x20;
3. Click on the `mitosheet.sheet()` code and press **Shift + Enter**

{% hint style="info" %}
Want help? Get in contact with our support team through [Discord](https://discord.gg/XdJSZyejJU), [Slack](https://join.slack.com/t/trymito/shared_invite/zt-1h6t163v7-xLPudO7pjQNKccXz7h7GSg), or by emailing <jake@sagacollab.com>
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trymito.io/how-to/creating-a-mitosheet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
