BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

I can't "import bitmex"... error message #267

Open nicix21 opened 6 years ago

nicix21 commented 6 years ago

Hello I'm quite newbie. I installed "bitmex" with pip and then I tried to "import bitmex" but here is the message I got from the terminal :

import bitmex Traceback (most recent call last): File "", line 1, in File "/home/john/.local/lib/python2.7/site-packages/bitmex.py", line 5, in from BitMEXAPIKeyAuthenticator import APIKeyAuthenticator File "/home/john/.local/lib/python2.7/site-packages/BitMEXAPIKeyAuthenticator.py", line 1, in import urllib.parse ImportError: No module named parse

If anyone could help.

vanishjournalist commented 5 years ago

The BitMEX python API is seemingly built for python3. In Python2, there is no urllib.parse package.

You could switch to Python3, or edit the first line in the BitMEXAPIKeyAuthenticator.py script and hope there is no other line that breaks under Python2.

From: import urllib.parse

To: import urlparse