How to use bitcoin-python I'm trying to create a bitcoin address with the bitcoin-python library.  I tried this code:

import bitcoinrpc
bitcoinrpc.connect_to_local().getnewaddress()


But I got this error:

error: [Errno 10061] No connection could be made because the target machine actively refused it


I am running the bitcoind daemon.  Why am I getting this error and how do I fix it?
or can someone direct me to an easier way to learn to develop with bitcoin -
Most likely you have not enabled JSON-RPC server in your bitcoin.conf.

You need to have:

# Enable JSON-RPC
server=1

# Username and password
rpcuser=foo
rpcpassword=bar

# This must be enabled for gettransaction() to work
txindex=1


For more information see

http://cryptoassetscore.readthedocs.org/en/latest/backends.html#module-cryptoassets.core.backend.bitcoind