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

import bitcoinrpc

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 -

  • Check bitcoind's log, which is debug.log in its configuration directory. It should contain some additional information. I suspect you forgot to set the RPC user name and password in bitcoin-python's configuration to allow it to connect to bitcoind. Commented Jan 14, 2015 at 23:57
  • Is bitcoind running? That's the error you would get if bitcoin weren't listening on its port.
    – Nick ODell
    Commented Jan 14, 2015 at 23:59
  • For easier way I am working with this Python project: bitbucket.org/miohtama/cryptoassets - expect 0.1 release in few days. Commented Jan 15, 2015 at 2:20
  • Ok now there is a release pypi.python.org/pypi/cryptoassets.core and tutorial file:///Users/mikko/code/cryptoassets/cryptoassets/docs/build/html/gettingstarted.html Commented Feb 6, 2015 at 10:11

2 Answers 2


Most likely you have not enabled JSON-RPC server in your bitcoin.conf.

You need to have:

# Enable JSON-RPC

# Username and password

# This must be enabled for gettransaction() to work

For more information see



Richard Kiss has made a nice library for creating/manipulating bitcoin addresses using python here: https://github.com/richardkiss/pycoin

That may be easier than getting RPC to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.