Comments (4)
I am unable to make any conclusion with just the information you pasted here.
How are you executing the script? Which script? Where?
Do you have the most up to date package?
To upgrade the package execute: sudo pip install [package_name] --upgrade
Thanks.
from bitcoinaddress.
Apologies the formatting was not done correctly. The issue is the example does not run. I have tried on multiple machines, same thing. Using git clone https://github.com/fortesp/bitcoinaddress
for my source. Running in ipython here is what happens:
Python 3.9.1 (default, Dec 16 2020, 02:20:47)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from bitcoinaddress import Wallet
In [2]: wallet = Wallet()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-ea0485b5b53f> in <module>
----> 1 wallet = Wallet()
~/bitcoinaddress/bitcoinaddress/wallet.py in __init__(self, hash_or_seed, testnet)
13 def __init__(self, hash_or_seed=None, testnet=False):
14 if hash_or_seed is None: hash_or_seed = Seed()
---> 15 self.key = Key.of(hash_or_seed)
16 self.address = Address.of(self.key)
17 self.testnet = testnet
~/bitcoinaddress/bitcoinaddress/key/key.py in of(obj)
57 key = Key()
58 if isinstance(obj, Seed):
---> 59 key._from_seed(obj)
60 else:
61 try:
~/bitcoinaddress/bitcoinaddress/key/key.py in _from_seed(self, seed)
77 self._generate_digest()
78 self._generate_hex()
---> 79 self.mainnet.generate_wif()
80 self.mainnet.generate_wif_compressed()
81 self.testnet.generate_wif()
~/bitcoinaddress/bitcoinaddress/key/key.py in generate_wif(self)
28
29 def generate_wif(self):
---> 30 self.wif = self.instance._generate_wif(Key.MainNet.PREFIX)
31
32 def generate_wif_compressed(self):
~/bitcoinaddress/bitcoinaddress/key/key.py in _generate_wif(self, prefix)
110 digest = prefix + self.digest
111 c = checksum(digest)
--> 112 return base58.b58encode(digest + c).decode('utf-8')
113
114 def _generate_wif_compressed(self, prefix, suffix):
AttributeError: 'str' object has no attribute 'decode'
In [3]:
from bitcoinaddress.
Which is fixed by removing the .decode('utf-8') in the key.py and address.py files that are referenced in the error messages, in case anyone hits this issue.
from bitcoinaddress.
Strange. I just tested it by creating a new venv and it works perfectly.
For instance:
python -m venv new_env
cd new_env
source bin/activate
pip install bitcoinaddress
python /path/to/test.py <--- with wallet = Wallet()
from bitcoinaddress.
Related Issues (16)
- Output is wrong HOT 1
- p2wsh addresses HOT 7
- Question | Which address is correct HOT 1
- Actually it's not issue, it's 2 questions HOT 1
- Why all generated address in range 00 and how to change range to 0000 HOT 1
- deleted
- Openssl removed ripemd160 - issues on Ubuntu22 HOT 2
- Why doesn't this work on Private Key WIF compressed ? HOT 2
- Add Hash160 HOT 1
- How to use it programatically? HOT 2
- How to display the address?
- 'seed' is not stored as instance variable in __init__ method of Key class HOT 1
- Need help HOT 2
- Need explanation on Wallet() HOT 1
- Compressed Public Address Error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitcoinaddress.