Installation#

To use starknet.py, ecdsa, fastecdsa, sympy dependencies are required. Depending on the operating system, different installation steps must be performed.

Linux#

sudo apt install -y libgmp3-dev
pip install starknet-py

MacOS#

Instructions assume Homebrew being installed.

Hint

If you are experiencing issues installing starknet.py related to fastecdsa on recent versions of MacOS consider installing cmake with version >=3.22.4.

brew install cmake

It is required to build crypto-cpp-py dependency in case it hasn’t been updated to support newest MacOS versions.

Intel processor#

brew install gmp
pip install starknet-py

Apple silicon#

brew install gmp
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install starknet-py

Windows#

You can install starknet.py on Windows in two ways:

  1. Install it just like you would on Linux.

In such case make sure that you have MinGW installed and up-to-date.

Hint

The recommended way to install is through chocolatey.

You also should have MinGW in your PATH environment variable (e.g. C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin).

Warning

Please be aware that you may encounter issues related to libcrypto_c_exports (e.g LoadLibraryEx). Installing MinGW via chocolatey and correctly adding it to the PATH should solve these issues.

If you encounter any further problems related to installation, you can create an issue at our GitHub or ask for help in #🐍 | starknet-py channel on Starknet Discord server.

  1. Use virtual machine with Linux, Windows Subsystem for Linux 2 (WSL2).