-
Notifications
You must be signed in to change notification settings - Fork 10
8. Installation Guide
The Devise Python package requires Python 3.5 or above and depends on cryptographic libraries for signing transactions and API requests. The following are platform specific installation steps starting from an empty environment.
Table of Contents
On Windows machines, you can install Python 3, and then install devise
from PyPi in a command line terminal (preferably in a virtual environment):
> pip3 install devise
On Ubuntu Linux 16.04 and above, you can install Python 3 and other required dependencies with the following command:
- Install Python 3 and other dependencies
$ sudo apt-get update && sudo apt-get install -y ca-certificates python3 python3-pip python3-pkgconfig libffi-dev dh-autoreconf libusb-1.0-0-dev libudev-dev
- Install
devise
from PyPi (preferably in a virtual environment):
$ pip3 install devise
By default, Mac OSX does not come with Python 3. The following steps install Python 3 and other dependencies required for the Devise Python package on OSX.
Open the Terminal application and run the following commands:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install Python 3 and required dependencies for Devise:
$ brew install python3 automake pkg-config libtool libffi gmp
- Install devise from PyPi (preferably in a virtual environment):
$ pip3 install devise
If you've followed the steps above and run into problems installing from PyPi, please upgrade your setuptools and try again:
pip3 install setuptools -U
pip3 install devise
For server environments and Windows platforms (Windows 10 Pro and up), we provide a preconfigured Python 3 Docker image that includes the Devise python package.
To install Docker for your platform, download and install Docker Community Edition here. Once installed, you'll be able to run any Docker virtual machine, including ours, from the command line.
The following command starts the Devise docker image, downloading it if necessary:
$ docker run -ti \
-p 127.0.0.1:3477:3477 \
-h localhost \
-v ~/.devise/:/home/ubuntu/.devise/ \
devisechain/python
Running the command above will start an Ubuntu virtual machine with a working installation of the devise
Python 3 package, numpy, pandas and a Jupyter notebook server accessible at http://localhost:3477/ by default:
...
[I 22:05:34.585 NotebookApp] Serving notebooks from local directory: /home/ubuntu/.devise/notebooks
[I 22:05:34.586 NotebookApp] 0 active kernels
[I 22:05:34.586 NotebookApp] The Jupyter Notebook is running at:
[I 22:05:34.586 NotebookApp] http://localhost:3477/
Note: The -v [local path]:[docker machine path] option allows you to share directories between your host machine and the Docker virtual machine.
On Linux hosts, if you wish to use a hardware wallet with your Docker virtual machine, you'll need to run the virtual machine in privileged mode:
$ docker run -ti \
--privileged
-p 127.0.0.1:3477:3477 \
-h localhost \
-v ~/.devise/:/home/ubuntu/.devise/ \
devisechain/python
The Dockerfile for this image is available here, and may be customized as needed.