# Anaconda Python environment in the Sandbox

Anaconda Python environment is available in the sandbox wrapped through [lmod linux tools](/working-in-the-sandbox/which-tools-are-available/anaconda-python-module-with-ready-set-of-scientific-packages.md). Apart from the [lmod linux tools](/working-in-the-sandbox/which-tools-are-available/anaconda-python-module-with-ready-set-of-scientific-packages.md), there is also Anaconda Python environment as docker image available in Sandbox with specific packages loaded. Details of the packages along with creation of docker image can be found in [git repo](https://github.com/FINNGEN/AnacondaPythonGCP).

### Run docker image

To run Anaconda Python environment release 1.0 type in the Terminal

`docker run -v $PWD:/home/ivm -v /finngen:/finngen -it eu.gcr.io/finngen-sandbox-v3-containers/anaconda_python/anaconda3:1.0 /bin/bash`

The above command takes you inside the docker image with mounted volumes of your home folder as well as finngen folder with all FinnGen data releases. Keep in mind there is only one python version which is 3.9.13. Any virtual environment created will be by default 3.9.13. There is no python2. Both python and python3 will load 3.9.13 version.

### Details of Anaconda Python environment

Once you are in the docker image, you can list the installed packages using the following command

`pip list`

You can also see a specific Python package and the version using the following command

`pip show <YOUR_PACKAGE_NAME>`

Anaconda Python comes with google cloud bigquery and pandas\_gbq packages which makes SQL query output to dataframe easy by running single line calls.

You can test pandas\_gbq by running the query using the following command within interactive terminal

`python -c 'from google.cloud import bigquery; import pandas_gbq; client = bigquery.Client(); query = """ SELECT FINNGENID FROM finngen-production-library.sandbox_tools_r10.finngen_r10_minimum_v1 LIMIT 10 """; df = pandas_gbq.read_gbq(query, project_id = client.project); print(df) '`

### Visualization packages

You can also do upset plots using [UpSet Plot](https://upsetplot.readthedocs.io/en/stable/index.html) package installed in the Anaconda Python environment.

### Additional package installations

Also, you can install a python package from the source by following the instructions from handbook page [install a Python package from the source](broken://pages/CN0t98g9lkLyYovi9Q7Y).

### Contact us

Users can also request any packages that they want to be added into the Anaconda environment which will be updated every few months. Request can be sent to`humgen-servicedesk@helsinki.fi`


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.finngen.fi/working-in-the-sandbox/quirks-and-features/docker-images/anaconda-python-environment-in-the-sandbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
