barnumbirr / coinmarketcap

A python wrapper around the https://coinmarketcap.com API.
Apache License 2.0
437 stars 110 forks source link

Still having python3 issues #13

Closed Jzarecta closed 8 years ago

Jzarecta commented 8 years ago

I am trying to run the module, I update the library but get a urllib error:

$ python3
Python 3.6.0a1 (default, Jun  6 2016, 14:59:56) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from coinmarketcap import Market
>>> coinmarketcap = Market()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.6/site-packages/coinmarketcap/core.py", line 15, in __init__
    self.opener = urllib.build_opener()
NameError: name 'urllib' is not defined
>>> 
barnumbirr commented 8 years ago

Hi there,

are you sure you updated the library properly? Works fine for me:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from coinmarketcap import Market
>>> coinmarketcap = Market()
>>> print(coinmarketcap.ticker("bitcoin"))
b'[\n    {\n        "id": "bitcoin", \n        "name": "Bitcoin", \n        "symbol": "BTC", \n        "rank": 1, \n        "price_usd": 648.839, \n        "price_btc": 1.0, \n        "24h_volume_usd": 78342500.0, \n        "market_cap_usd": 10237168923.0, \n        "available_supply": 15777672.0, \n        "total_supply": 15777672.0, \n        "percent_change_1h": -0.8, \n        "percent_change_24h": -1.5, \n        "percent_change_7d": -3.42\n    }\n]'
barnumbirr commented 8 years ago

@Jzarecta did you manage to get this working?

Jzarecta commented 8 years ago

yeah is working, the issue was on the lxml module.