-
Notifications
You must be signed in to change notification settings - Fork 5
πͺ Run web3cli on Windows
coccoinomane edited this page Feb 12, 2023
·
4 revisions
- Search for "PowerShell" in the Windows menu and open it.
- Type
python --version
and press enter. If you read something likePython 3.10.9
then you already have Python installed and can proceed to the next section. If you receive an error message... - Just type
python
. A Microsoft Store window should open, from which you can install Python. - After the installation is complete, run
python --version
again: this time you should see an output similar toPython 3.10.9
.
- Open PowerShell and run
pip install -U web3cli
. - Wait a minute or two while web3cli is installed. There might be some yellow warnings complaining about the path: ignore them.
- If you run
python -m web3cli.main
, you should see the list of web3cli commands.
If everything went fine, you should be able to run web3cli using the syntax python -m web3cli.main <command>
. But we are not born for suffering, so let's enable the shorthand w3 <command>
:
- In PowerShell, run
python -m site --user-site
, and copy the output. It should be something like this:C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbw1q2kfra8c3\LocalCache\local-packages\Python310\site-packages
- Open the Windows menu and start typing the word "environment". The first result should be "Edit the environment variables": click on it.
- Locate the "Path" variable in the window, and double click on it.
- A new window will appear with the content of the "Path variable". Let's click on "New" to add a new element to the variable.
- Write in the row the output of the command
python -m site --user-site
, the one you copied before, with a slight modification: replace thesite-packages
piece at the end withScripts
. It should look something like this:C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbw1q2kfra8c3\LocalCache\local-packages\Python310\Scripts
Now you should be able to run web3cli in PowerShell using the w3
shorthand, as well as the other chain-specific commands: w3eth
, w3bnb
, w3avax
, w3matic
, etc. Congratulations!