0

I'm completely new to python (and programming), and I know this question will sound very dumb to most of you people. I'm experimenting on getting datas from the cryptocurrencies exchenge bittrex and put it into variables into my script for further calculations. I'm trying to make this unofficial repository working to fetch datas from their api. While I have no problems with the public datas (fetching with curl), I can't get this piece of python to work, and thus I can't fetch balances nor any other private datas.

In order to install it I made the following:

wget https://github.com/ericsomdahl/python-bittrex/archive/master.zip
unzip master.zip
cd python-bittrex-master
python setup.py install

The following files were created:

ls -la /usr/local/lib/python2.7/dist-packages/bittrex/
total 48
drwxr-sr-x 2 root staff  4096 Sep 30 15:04 .
drwxrwsr-x 3 root staff  4096 Sep 30 15:04 ..
-rw-rw-r-- 1 root staff 15357 Sep 12 18:34 bittrex.py
-rw-r--r-- 1 root staff 17302 Sep 30 15:04 bittrex.pyc
-rw-rw-r-- 1 root staff     0 Sep 12 18:34 __init__.py
-rw-r--r-- 1 root staff   145 Sep 30 15:04 __init__.pyc

Then I created this test files, but they are both producing no output:

cat get_balances.py 
#!/usr/bin/env python 
from bittrex.bittrex import Bittrex
api = Bittrex('fXXXXXXXXXXXXXXXXXXXXXXXXXd', '1XXXXXXXXXXXXXXXXXXXXXXXXX0')
api.get_balances() 

and

cat get_markets.py 
#!/usr/bin/env python 
from bittrex.bittrex import Bittrex    
api = Bittrex('fXXXXXXXXXXXXXXXXXXXXXXXXXd', '1XXXXXXXXXXXXXXXXXXXXXXXXX0')    
api.get_markets()

Before I did python setup.py install the output was: ImportError: cannot import name Bittrex

I tried to troubleshoot it running with python -v in front but it did produce 500 lines of output that I didn't manage to understand, I'd share it of course if someone asks for it.

While I'm writing I'm sure I'm missing something very trivial, sorry if it's a dumb question, but documentation is lacking any principle, it's very few and it assumes that who is integrating this code is a developer; and I'm not.

Following suggestions from another forum I did:

root@my:/home/me/test/python-bittrex-master# pip install bittrex
Downloading/unpacking bittrex
  Downloading bittrex-0.1.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/bittrex/setup.py) egg_info for package bittrex

Downloading/unpacking requests==2.7.0 (from bittrex)
  Downloading requests-2.7.0-py2.py3-none-any.whl (470kB): 470kB downloaded
Installing collected packages: bittrex, requests
  Running setup.py install for bittrex

  Found existing installation: requests 2.2.1
    Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed bittrex requests
Cleaning up...


python get_balances.py 
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

So there is a warning, but still no output.

If you try the code I pasted as is, it should return "invalid api", while it throws no output on my system. How to troubleshoot this?

1 Answer 1

0

Try...

balance = api.get_balances() print balance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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