Questions tagged [web3py]

Web3.py is a library for interacting with EVM based blockchains and smart contracts in Python.

For more information see Web3.py documentation.

Web3.py is maintained by Ethereum Foundation.

578 questions
2
votes
1 answer

Error in importing Web3 into Google Colab

I am trying to install web3 in Google Colab, and the first step is !pip install web3 this concludes successfully with -- what seems to be -- a trivial error ERROR: nbclient 0.5.1 has requirement jupyter-client>=6.1.5, but you'll have jupyter-client…
Calcutta
  • 1,021
  • 3
  • 16
  • 36
2
votes
1 answer

Send signed transaction from Trezor hardware wallet

I've been trying to code a simple web3.py program to send a transaction from my Trezor. I'm able to sign the transaction on my Trezor, and the function that does that (ethereum.sign_tx()) returns a tuple of the V, R, and S signatures of the…
Isaac
  • 45
  • 1
  • 5
2
votes
1 answer

How to read Data field of Ethereum transaction

I'm trying to post a transaction with a message on a local ethereum blockchain using the data field. I don't know how to retrieve the message. code: import web3 w3 = web3.Web3(web3.HTTPProvider("http://127.0.0.1:7545")) alice =…
Jack
  • 41
  • 1
  • 5
2
votes
2 answers

Eth, how to call a deposit function from a smart contract

I am working on a project where I need to send ether from an user to a smart contract and from the smart contract to the user. The smart contract is code in Solidity and I'm using python and web3.py to communicate with it. I manage to do it like…
user11557577
2
votes
1 answer

cannot install web3 in python virtual_enviroment

I am using $pip install web3 inside a python_virtual_env, but I get the error below. Defaulting to user installation because normal site-packages is not writeable Collecting web3 Using cached web3-5.7.0-py3-none-any.whl (460 kB) …
2
votes
1 answer

Web3.py abi keyerror while calling a function on ganache

I have compiled my code in remix ide. it is working fine there. I copied the bytecode and adi from compilation detail to my python code. I am using web3.py as an external library. but when I try to run my function, I am getting an error keyerror. I…
2
votes
1 answer

Calling Solidity Function using Python Web3.py

I have written a smart contract function using solidity consisting of different parameters given below function addDevice(address _address, string _deviceType, string _deviceName, string _minerID, string _deviceID) public { DeviceData storage…
Khizar Hameed
  • 41
  • 1
  • 7
2
votes
4 answers

pip install web3 not installing

any advice would be greatly appreciated. I have installed visual studio like it tells me in the error and I have also attempted to pip install this in a venv environment however its still not working I have included the full error message below. The…
carl walters
  • 159
  • 1
  • 3
  • 11
2
votes
1 answer

How to use filters with web3py to get event logs for a smart contract?

I'm looking to get event logs for a smart contract and I'm using Infura nodes for this. According to the documentation provided here, I tried running new_block_filter = web3.eth.filter('latest') I think this should have been new_block_filter =…
coolgugs
  • 41
  • 1
  • 4
2
votes
1 answer

Workings of web3.EthereumTesterProvider()?

Reading the web3.py docs, there are 3 providers, namely HTTPProvider, IPCProvider and WebsocketProvider. Following the quickstart guide on deploying contracts, what does the following line do: w3 = Web3(Web3.EthereumTesterProvider()) I could not…
Bobby
  • 53
  • 5
2
votes
1 answer

geth ethereum client connect to ganache

I want to set up a private Ethereum Testnet on different computers within one network. I have my private Computer with a working web3.py Implementation connected to a Ganachi Testnet. I can deploy Smart Contracts from a program written in python…
2
votes
1 answer

How to make a Docker container talk to geth on local host

I have a simple python script using web3 Dockerized and I'm trying to connect to geth.ipc on local host and I can't seem to connect to it. Is there a way to do it? Python: from web3 import Web3 web3 =…
Eric
  • 25
  • 4
2
votes
1 answer

how to pass parameters from Django view to contract function using web3.py

I have a contract which has a payout function with three inputs: function payout(uint256[] ids, address[] recipients, uint256[] amounts) public authorized { require(ids.length == recipients.length && ids.length == amounts.length); for (uint i =…
yasaman.h
  • 81
  • 8
2
votes
1 answer

405 Client Error: Method Not Allowed for url: https://rinkeby.infura.io

I can't call create filter on my contract, this is my code below. I am able to get the contract and run functions on it, but I cant listen to events: myContract = w3.eth.contract(address="some_address",abi=contract_abi) This is where I run into…
rabiaasif
  • 305
  • 3
  • 6
  • 21
2
votes
1 answer

pip install web3 @ ubuntu error - cannot install web3

I'm having the following issue when trying to install web3 from pip: $ sudo pip install web3 The directory '/home/chris/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the…
Chris Russo
  • 450
  • 1
  • 7
  • 21