Unable to compile contracts on Windows machine
Describe the bug
I'm facing a couple of issues when using Algo Builder to compile contracts on windows machine. I've attached the screenshots as shown below.
-
This occurs because the framework uses
python3command to compile the contracts. I'm currently using anaconda python virtual environment on Windows 10. It usespythoninstead.
-
This occurs after I've updated the file in
node_modules/@algo-builder/runtime/build/lib/pycompile-op.jsto usepythoninstead ofpython3.
I believe issue 2 is because of the different error numbers used by nodeJS for mac and windows machines. I had to replace the e?.errno === -2 with e?.errno === -4058 on line number 103 so that framework can detect missing generated yaml files and continue the process of compilation. The file is located in /node_modules/@algo-builder/algob/build/lib/compile.js
Possible Solution
- Not sure if there's a way to try running the compilation with
python3orpythonorpy. - Maybe we can detect the OS and dynamically change the error number detection accordingly?
Steps to Reproduce
- Run
yarn run algob compileon a new Algo Builder project on Windows 10.
Environment
- OS: Windows 10, Windows 11
- Node.js version: v16.15.0
- algob version: 3.2.0
- Python: 3.9.12 (using anaconda)
Thank @afcharliekong for report the issue! Could you share your source code?
I also recommend use window WSL when work with algob.
Hi @vuvoth, I've attached the source code of a new Algo Builder project with the changes made in these files,
node_modules/@algo-builder/runtime/build/lib/pycompile-op.js (lines 85, 89)
node_modules/@algo-builder/algob/build/lib/compile.js (lines 103)
Hope it helps.
I had windows WSL installed as well when this compilation issue occured.
I had windows WSL installed as well when this compilation issue occured.
Did you install pyteal and pyyaml before run compile, @afcharliekong ?
I had to replace the e?.errno === -2 with e?.errno === -4058 on line number 103 so that framework can detect missing generated yaml files and continue the process of compilation.
Let change it back to default value.
Hey @vuvoth, I did have pyteal and pyyaml installed. Did a pip list to verify this.

What's your python version (when you run python)? It must be 3.9 or later , latest PyTEAL supports only Python 3.10 in fact, which will be required in our upcoming release (algo-builder v4.0).
I'm running python version 3.9.12 on my anaconda virtual environment.
Could you try to use Pipenv? https://algobuilder.dev/guide/README#pyteal
BTW, we have just released Algo Builder v4.0. It requires Python 3.10 (this is due to PyTEAL - it's latest release requires Python 3.10).
Hey @robert-zaremba,
I've switched to Python 3.10
Also using Pipenv and these are the packages installed based on the Pipfile in the repo,
Tried to setup a clean installation using v4.0
And there's a new error instead =(
hmm, could be related to Node... What is your version of Node.js? node --version? We require v16 or later.
I'm using node v16.15.0