# Download dx-toolkit

The Advanced Analysis for Precision cancer Therapy Treatment and Analysis Platform (ADAPT TAP) is built on the DNAnexus Platform. Below are instructions to download the DNAnexus SDK, known as dx-toolkit, in order to access ADAPT TAP via the command line interface. \\

* The DNAnexus Platform SDK - also called dx-toolkit - includes the dx command-line client; tools for building and debugging apps; utilities for working with data on ADAPT-TAP; and Python, Java, C++ and R bindings for working on UKB-RAP.
* The SDK is released under the[ Apache v2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html). This SDK does not collect any user identifiable information.

## Installing the Python SDK and Command Line Tools

### Before You Begin

Before installing the Python SDK and command line tools, ensure that you are running[ Python 3.](https://www.python.org/downloads/)

### Installation

The SDK's Python components - dxpy bindings and command line tools, including dx- are distributed through[ PyPI](https://pypi.org/project/dxpy/). Use[ pip3](http://www.pip-installer.org/) to download and install the[ dxpy](https://pypi.python.org/pypi/dxpy) package:

```
pip3 install dxpy
```

If you see a warning similar to the one below, please update your PATH environment variable to include the path where pip3 installed the new commands.

```
WARNING: The scripts dx, dx-app-wizard, dx-build-app and dx-build-applet are installed in
'/Users/user-amy/Library/Python/3.9/bin'  which is not on PATH.

Consider adding this directory to PATH
```

### Enabling Tab Completion

If you're using Z shell (zsh), which is included in recent versions of OS X, enable tab completion by entering the following command, or adding it to your .zshrc:

```
autoload -Uz compinit && compinit

autoload bashcompinit && bashcompinit

eval "$(register-python-argcomplete dx|sed 's/-o default//')"

```

If you're not using Z shell (zsh), enable tab completion by entering the following command, or add it to your .bashrc:

```
eval "$(register-python-argcomplete dx|sed 's/-o default//')"
```

### Upgrading dxpy

To upgrade the dxpypackage after installing it using pip3, enter the command:

```
pip3 install --upgrade dxpy
```

## Troubleshooting

If you're using the OS X Xcode command line tools and running Python 3, the `psutil` dependency may fail to compile. To prevent this from happening, set export `ARCHFLAGS="-arch x86_64"` before installing dxpy.

To avoid character set problems when running the dx command, set the `PYTHONIOENCODING` environment variable to UTF-8 as follows:

`export PYTHONIOENCODING=UTF-8`

On Windows, Windows 10 and later versions are supported. If you encounter the error `ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108) error` when running `dx` commands, such as `dx head file-xxx`, install `python-certifi-win32` using `pip install python-certifi-win32`.

## Building from Source

See the Readme.md file in the[ dx-toolkit Github repository](https://github.com/dnanexus/dx-toolkit#installing-the-toolkit-from-source) for information on build-time dependencies, Java, C++ and R bindings and additional installation instructions.
