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

binascii.Error: Invalid base64-encoded string: number of data characters (17) cannot be 1 more than a multiple of #187

Open
Ruby-Coleman opened this issue May 20, 2020 · 2 comments

Comments

@Ruby-Coleman
Copy link

So I downloaded the module at https://github.com/BTCMarkets/api-v3-client-python and I placed main.py inside of the Lib folder, but whenever I try 'import main' in the python interpreter, I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\main.py", line 97, in <module>
    client = BTCMarkets(api_key, private_key)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\main.py", line 72, in __init__
    self.privateKey = base64.b64decode(privateKey)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (17) cannot be 1 more than a multiple of 4
@martin-nginio
Copy link
Contributor

Hi @Ruby-Coleman

Thanks for your feedback.

This demo app has been tested with Python 3.5.2 and it should work works after adding your API key and private key in the code (near the end of the file).

If it does not work with newer versions of Python3, please let us know and we will upgrade the sample.

Thanks.

Regards,
Martin

@prashantidealittechno
Copy link

prashantidealittechno commented Jun 2, 2022

No it is not working I am getting the same error.

binascii.Error: Invalid base64-encoded string: number of data characters (117) cannot be 1 more than a multiple of 4

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

3 participants