I'm running bitcoind/ bitcoind -regtest on Windows 10 and am already able to use bitcoin-cli -regtest along with json-rpc methods to perform basic operations and get balances etc. When I try to do this programmatically on python 3 using Jeff Garzik's python-bitcoinrpc package (
https://github.com/jgarzik/python-bitcoinrpc) I get a modulenotfounderror. However, my pip3 freeze shows python-bitcoinlib==0.10.1 and also python-bitcoinrpc==1.0.
My code is below (18443 is the regtest port):
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
rpc_connection = AuthServiceProxy("
http://%s:%s@127.0.0.1:18443"%("myrpcuser", "myrpcpassword"))
best_block_hash = rpc_connection.getbestblockhash()
print(rpc_connection.getblock(best_block_hash))
What am I doing wrong?