ttsteiger / cryptocompy

Simple Python 3 wrapper for the public CryptoCompare API.
MIT License
82 stars 36 forks source link

using any function in top doesn't work #6

Open hyalkaf opened 6 years ago

hyalkaf commented 6 years ago

I'm running some python 3 code in a juypter notebook and I tried to to do

from cryptocompy import coin, top

top.get_top_coins("USD", 10)

However I'm getting this error.

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-30-d1a747a58826> in <module>()
      1 import pandas
----> 2 from cryptocompy import coin, top
      3 
      4 top.get_top_coins("USD", 10)

~\Anaconda3\lib\site-packages\cryptocompy\top.py in <module>()
      1 # top.py
      2 
----> 3 from helper_functions import build_url, load_data
      4 
      5 def get_top_exchanges_by_volume(fsym, tsym, limit=5):

ModuleNotFoundError: No module named 'helper_functions'
gstqtfr commented 6 years ago

Same problem for me, too!

gstqtfr commented 6 years ago

Looking at this, it's an import problem.

In mining.py and top.py (both of which throw the ModuleNotFoundError: No module named 'helper_functions' error, we have:

from helper_functions import build_url, load_data, ...

whereas the others use:

from .helper_functions import build_url, load_data, ...

Editing the import statements to relative imports fixes this for me.

connorlee77 commented 6 years ago

Could the python package be updated with this change?