ndri / python-bittrex

Python library for the Bittrex API
67 stars 45 forks source link

Getting an error trying to initialize the library #6

Open faridelnasire opened 6 years ago

faridelnasire commented 6 years ago

I'm getting the following error: TypeError: 'module' object is not callable

Not doing anything special yet, just trying to connect to Bittrex like so:

#!/usr/bin/env python
from bittrex import bittrex

api = bittrex(api_key, api_secret)
ndri commented 6 years ago

Are you sure you're doing from bittrex import bittrex, not just import bittrex?

alexsktl commented 6 years ago

First of all download bittrex.py and paste it to the project directory. Then you should change signature = hmac.new(self.secret, url, hashlib.sha512).hexdigest() to signature = hmac.new(self.secret.encode('utf-8'), url.encode('utf-8'), hashlib.sha512).hexdigest()