Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'bitcoin_tools.core' #26

Open
santoshgadagamma opened this issue Dec 19, 2020 · 5 comments
Open

No module named 'bitcoin_tools.core' #26

santoshgadagamma opened this issue Dec 19, 2020 · 5 comments

Comments

@santoshgadagamma
Copy link

Hello,

I am installing all the packages using pip command but still i am facing the below error.

Traceback (most recent call last):
File "C:\Users\GSK\AppData\Local\Programs\Python\Python37-32\mybit.py", line 1, in
from bitcoin_tools.core.keys import generate_keys, store_keys
ModuleNotFoundError: No module named 'bitcoin_tools.core'

How can i overcome this error. Please guide me.

@sr-gi
Copy link
Owner

sr-gi commented Dec 21, 2020

Looks like you're trying to install the library using Python3, but the library is written in Python2.

You should use a Python2 interpreter.

@santoshgadagamma
Copy link
Author

santoshgadagamma commented Jan 1, 2021

The above issue is resolved but new issue raised, see the below description.
How to resolve this issue.
Traceback (most recent call last):
File "<pyshell#3>", line 1, in
from bitcoin_tools.core.keys import generate_keys, store_keys
File "C:\Python27\lib\site-packages\bitcoin_tools_init_.py", line 1, in
from bitcoin_tools.S256Point import *
File "C:\Python27\lib\site-packages\bitcoin_tools\S256Point.py", line 168, in
0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8)
File "C:\Python27\lib\site-packages\bitcoin_tools\S256Point.py", line 32, in init
a, b = S256Field(A), S256Field(B)
File "C:\Python27\lib\site-packages\bitcoin_tools\S256Point.py", line 16, in init
super().init(num=num, prime=P)
TypeError: super() takes at least 1 argument (0 given)

@sr-gi
Copy link
Owner

sr-gi commented Jan 5, 2021

Can you provide what file or script are you running so I can test this myself?

@santoshgadagamma
Copy link
Author

Installing packages
pip install python_bitcoin_tools
pip install bit
See the below script which is provided in the website.

from bitcoin_tools.core.keys import generate_keys, store_keys
from bitcoin_tools.wallet import generate_wif, generate_btc_addr

First of all the ECDSA keys are generated.

sk, pk = generate_keys()

Then, the Bitcoin address is derived from the public key created above.

btc_addr = generate_btc_addr(pk)

Both the public and private key are stored in disk in pem format. The Bitcoin address is used as an identifier in the

name of the folder that contains both keys.

store_keys(sk.to_pem(), pk.to_pem(), btc_addr)

Finally, the private key is encoded as WIF and also stored in disk, ready to be imported in a wallet.

generate_wif(btc_addr, sk)

And error:

Traceback (most recent call last):
File "C:\Python27\FirstBtc.py", line 1, in
from bitcoin_tools.core.keys import generate_keys, store_keys
File "C:\Python27\lib\site-packages\bitcoin_tools_init_.py", line 1, in
from bitcoin_tools.S256Point import *
File "C:\Python27\lib\site-packages\bitcoin_tools\S256Point.py", line 168, in
0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8)
File "C:\Python27\lib\site-packages\bitcoin_tools\S256Point.py", line 32, in init
a, b = S256Field(A), S256Field(B)
File "C:\Python27\lib\site-packages\bitcoin_tools\S256Point.py", line 16, in init
super().init(num=num, prime=P)
TypeError: super() takes at least 1 argument (0 given)

i am using python2.

@sr-gi
Copy link
Owner

sr-gi commented Jan 8, 2021

Oh OK, I see.

Looks like you have not properly installed the library. You need to follow the installing instructions under INSTALL.md, otherwise python cannot find the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants