<p>Most likely you have not enabled JSON-RPC server in your <code>bitcoin.conf</code>.</p>

<p>You need to have:</p>

<pre><code># Enable JSON-RPC
server=1

# Username and password
rpcuser=foo
rpcpassword=bar

# This must be enabled for gettransaction() to work
txindex=1
</code></pre>

<p>For more information see</p>

<p><a href="http://cryptoassetscore.readthedocs.org/en/latest/backends.html#module-cryptoassets.core.backend.bitcoind" rel="nofollow">http://cryptoassetscore.readthedocs.org/en/latest/backends.html#module-cryptoassets.core.backend.bitcoind</a></p>

CC BY-SA 3.0
2015-01-15T02:19:25.053Z
2015-01-15T02:19:25.053Z
Mikko Ohtamaa
<p>Richard Kiss has made a nice library for creating/manipulating bitcoin addresses using python here: <a href="https://github.com/richardkiss/pycoin" rel="nofollow">https://github.com/richardkiss/pycoin</a></p>

<p>That may be easier than getting RPC to work.</p>

CC BY-SA 3.0
2015-01-28T16:12:31.983Z
2015-01-28T16:12:31.983Z
Jimmy Song
<p>I'm trying to create a bitcoin address with the <a href="https://github.com/laanwj/bitcoin-python" rel="nofollow">bitcoin-python</a> library.  I tried this code:</p>

<pre><code>import bitcoinrpc
bitcoinrpc.connect_to_local().getnewaddress()
</code></pre>

<p>But I got this error:</p>

<pre><code>error: [Errno 10061] No connection could be made because the target machine actively refused it
</code></pre>

<p>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 -</p>

CC BY-SA 3.0
2015-01-14T23:57:53.867Z
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.
David A. Harding
CC BY-SA 3.0
2015-01-14T23:59:00.537Z
Is bitcoind running? That's the error you would get if bitcoin weren't listening on its port.
Nick ODell
CC BY-SA 3.0
2015-01-15T02:20:14.253Z
For easier way I am working with this Python project: https://bitbucket.org/miohtama/cryptoassets - expect 0.1 release in few days.
Mikko Ohtamaa
CC BY-SA 3.0
2015-02-06T10:11:28.247Z
Ok now there is a release http://pypi.python.org/pypi/cryptoassets.core and tutorial file:///Users/mikko/code/cryptoassets/cryptoassets/docs/build/html/gettingstarted.html
Mikko Ohtamaa
<bitcoind><bitcoin-core><python>
How to use bitcoin-python
bunyhel
# How to use bitcoin-python

(Asked by: username_0 on 2015-01-14)

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 -

**Tags:** bitcoind, bitcoin-core, python

> **Comments:**
> **username_1**: 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.  
> **username_2**: Is bitcoind running? That's the error you would get if bitcoin weren't listening on its port.  
> **username_3**: For easier way I am working with this Python project: https://bitbucket.org/miohtama/cryptoassets - expect 0.1 release in few days.  
> **username_3**: Ok now there is a release http://pypi.python.org/pypi/cryptoassets.core and tutorial file:///Users/mikko/code/cryptoassets/cryptoassets/docs/build/html/gettingstarted.html  

---

## 2 answers

### Answer by username_3 on 2015-01-15. Score: 1

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


---

### Answer by username_4 on 2015-01-28. Score: 0

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.


---

