running Brownie on Windows in a virtual environment without encountering Cytoolz errors

n4n0b1t3
2 min readFeb 7, 2022

This article relates to the excellent Solidity, Blockchain, and Smart Contract Course — Beginner to Expert Python Tutorial by Patrick Collins.

If you are running into difficulties installing brownie as described in the video in lesson 5, this article here might help to solve the issue. After the kind feedback from @cromewar that pipx is not necessary, I was able to simplify the installation significantly. AND!!! We can use Python's virtual environment. \o/ Here is the result:

Install part of the Visual C++ build tools: Download and install https://visualstudio.microsoft.com/visual-cpp-build-tools/

Visual Studio Build Tools installation

Select only the module ticked off in the screenshot (here is a German system) and continue with the installation.

Open Powershell and create your project directory with e.g.
>mkdir brownie_simple_storage
Change to the project directory
>cd brownie_simple_storage

Create a virtual environment
brownie_simple_storage>python -m venv .venv

Activate the virtual environment
brownie_simple_storage>.\.venv\Scripts\Activate.ps1

Optional: update pip
(.venv) brownie_simple_storage>python.exe -m pip install --upgrade pip

Important, otherwise you will get the infamous error: Install Cython
(.venv) brownie_simple_storage>pip install Cython

Finally, install brownie
(.venv) brownie_simple_storage>pip install eth-brownie

Test Brownie with
(.venv) brownie_simple_storage>brownie --version

Now… Brownie is a little shy and wants his own room. No open office for Brownie.

(.venv) brownie_simple_storage>mkdir sources
(.venv) brownie_simple_storage>cd sources
(.venv) sources>brownie init

OK, not finished yet. Brownie depends on “ganache-cli” which is deprecated but the new “ganache” works just fine. There is one step included for which you will need elevated rights, so please open Powershell as admin.
(press Win key >enter “powershell” > right click on Powershell in start menu > select “run as administrator” > confirm > navigate to your project directory).

Activate your virtual environment
brownie_simple_storage>.\.venv\Scripts\Activate.ps1

Install Nodeenv
(.venv) brownie_simple_storage>pip install nodeenv

Connect nodeenv with your virtual Python environment
(.venv) brownie_simple_storage>nodeenv -p

Install ganache
(.venv) brownie_simple_storage>npm install -g ganache

Test ganache
(.venv) brownie_simple_storage>ganache --version

run *.py script with Brownie

(.venv) brownie_simple_storage>cd sources
(.venv) sources>brownie run .\scripts\deploy.py

As always, new technology is changing fast. And this article might be out of date tomorrow. If you need help, please come to the courses GitHub repository and join the very nice community.

Have fun!

--

--