Installing Vyper¶
Take a deep breath, follow the instructions, and please create an issue if you encounter any errors.
Note
The easiest way to experiment with the language is to use the Remix online compiler. (Activate the vyper-remix plugin in the Plugin manager.)
Docker¶
Vyper can be downloaded as docker image from dockerhub:
docker pull vyperlang/vyper
To run the compiler use the docker run
command:
docker run -v $(pwd):/code vyperlang/vyper /code/<contract_file.vy>
Alternatively you can log into the docker image and execute vyper on the prompt.
docker run -v $(pwd):/code/ -it --entrypoint /bin/bash vyperlang/vyper
root@d35252d1fb1b:/code# vyper <contract_file.vy>
The normal parameters are also supported, for example:
docker run -v $(pwd):/code vyperlang/vyper -f abi /code/<contract_file.vy>
[{'name': 'test1', 'outputs': [], 'inputs': [{'type': 'uint256', 'name': 'a'}, {'type': 'bytes', 'name': 'b'}], 'constant': False, 'payable': False, 'type': 'function', 'gas': 441}, {'name': 'test2', 'outputs': [], 'inputs': [{'type': 'uint256', 'name': 'a'}], 'constant': False, 'payable': False, 'type': 'function', 'gas': 316}]
Note
If you would like to know how to install Docker, please follow their documentation.
PIP¶
Installing Python¶
Vyper can only be built using Python 3.6 and higher. If you need to know how to install the correct version of python, follow the instructions from the official Python website.
Creating a virtual environment¶
It is strongly recommended to install Vyper in a virtual Python environment, so that new packages installed and dependencies built are strictly contained in your Vyper project and will not alter or affect your other development environment set-up. For easy virtualenv management, we recommend either pyenv or Poetry.
Note
To find out more about virtual environments, check out: virtualenv guide.
nix¶
View the versions supported through nix at nix package search
Note
The derivation for Vyper is located at nixpkgs
Installing Vyper¶
nix-env -iA nixpkgs.vyper