# Install new library

This tutorial will guide you through adding new libraries to your Float16 remote instance. Since the remote instance starts as an empty container, you need to install libraries before running your code.

{% hint style="info" %}

* Float16 CLI installed and logged in
* If not logged in, refer to the [Hello World tutorial](https://docs.float16.cloud/getting-started/serverless-gpu/tutorials/hello-world)
  {% endhint %}

This example scenario, we'll use a script 'cat.py' that imports the 'requests' library to fetch data from a cat fact API.

```python
import requests

cat_fact = requests.get('https://catfact.ninja/fact')
if cat_fact.status_code == 200:
    print("\nFun fact about cats:")
    print(cat_fact.json()['fact'])
```

While you can simply use `pip install requests` on your local machine, the process is different for the remote instance.

## Step 1 : Create requirements.txt

Create a requirements.txt file to specify dependencies.

```bash
float16 init
```

This command creates both 'float16.conf' and 'requirements.txt' files.

Open 'requirements.txt' and add the following

```
requests==2.31.0
```

This specifies the library name and the version you want to install.

## Step 2 : Start the Project

Start the container, which automatically installs packages listed in 'requirements.txt'

```bash
float16 project start
```

## Step 3 : Update Libraries (if needed)

After starting the project and successfully installing packages, you might find that the installed version doesn't match your local version. This could potentially affect your code. Here's how to update

{% hint style="info" %}
Check the current version: `pip show <PACKAGE> | grep Version` or `pip list`
{% endhint %}

To upgrade the version (e.g., from '2.31.0' to '2.32.3'), edit 'requirements.txt'

```
requests==2.32.3
```

Update package dependencies

```bash
float16 project install
```

## Step 4 : Run Your Script

Execute your script

```bash
float16 run cat.py
```

Example output (The response is randomly generated, so you may see a different cat fact.):

{% code overflow="wrap" %}

```bash
Fun fact about cats:
The average lifespan of an outdoor-only cat is about 3 to 5 years while an indoor-only cat can live 16 years or much longer.
```

{% endcode %}

{% hint style="success" %}
Congratulations! You've become proficient in installing new libraries in your Float16 remote instance.
{% endhint %}

## Explore More&#x20;

Learn how to use Float16 CLI for various use cases in our tutorials.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Hello World</strong></td><td>Launch your first serverless GPU function and kickstart your journey.</td><td><a href="hello-world">hello-world</a></td></tr><tr><td><strong>Install new library</strong></td><td>Enhance your toolkit by adding new libraries tailored to your project needs.</td><td><a href="install-new-library">install-new-library</a></td></tr><tr><td><strong>Copy output from remote</strong></td><td>Efficiently transfer computation results from remote to your local storage.</td><td><a href="s3-copy-output-from-remote">s3-copy-output-from-remote</a></td></tr><tr><td><strong>Deploy FastAPI Helloworld</strong></td><td>Quick start to deploy FastAPI without change the code.</td><td><a href="server-mode">server-mode</a></td></tr><tr><td><strong>Upload and Download via CLI and Website</strong></td><td>Direct upload and download file(s) to server.</td><td><a href="direct-upload-and-download">direct-upload-and-download</a></td></tr><tr><td><strong>More examples</strong></td><td>Open source from community and Float16 team.</td><td><a href="etc.">etc.</a></td></tr></tbody></table>

Happy coding with Float16 Serverless GPU!
