1

This is somewhat Python-based, but I feel it is more a Bitcoin question than a Python question.

The problem is running pybitcointools and python-bitcoinlib concurrently, as both packages use the name bitcoin. This BountySource discussion sums up the issue succinctly:

It seems that on PyPi the name bitcoin is free but... (the) ... python-bitcoinlib package on installation uses the same name "bitcoin" as the current pybitcointools, and I've had them clash (one overwrote the other)

It's also worth noting that using pip, pip install pybitcointools = version 1.1.15, whereas pip install bitcoin = version 1.1.25 (newer version).

I generally prefer Python 2.7 but whatever solutions may be applicable just to Python 3.x would also be greatly appreciated, as using both libraries concurrently would be great.

1

Not sure if you can do it as they seem to be the same package.

For python-bitcoinlib here:

Author: Vitalik Buterin

Home Page: http://github.com/vbuterin/pybitcointools

Package Index Owner: vbuterin

DOAP record: bitcoin-1.1.26.xml

For pybitcointools here:

Author: Vitalik Buterin

Home Page: http://github.com/vbuterin/pybitcointools

Package Index Owner: vbuterin

DOAP record: pybitcointools-1.1.15.xml

They point to the same package on github (just different versions) and running them at the same time is probably not a good idea. My guess is that Vitalik changed the python package name from pybitcointools to bitcoin when he realized the second was available.

That said, if you really need to use both packages, you can do something like this answer. Note you'll have to install manually, probably installing from source using github.

0

I ended up working out how to do this using iPython. It's just a matter of changing directories in Python, which I do with this dict:

>>> PATH

{'pybtc': 'b:\\pybtc\\pybitcointools', 'python-bitcoinlib': 'b:\\pybtc\\python-bitcoinlib'}

For pybitcointools:

>>> os.chdir(PATH['pybtc'])
>>> import bitcoin as btc

For python-bitcoinlib:

>>> os.chdir(PATH['python-bitcoinlib'])
>>> from bitcoin.core import *

I'll leave it there, as Jimmy Song's answer fills in the rest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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