ericsomdahl / python-bittrex

Python bindings for bittrex
MIT License
585 stars 283 forks source link

ImportError: No module named bittrex #106

Closed fabius8 closed 6 years ago

fabius8 commented 6 years ago
#!/usr/bin/env python

from bittrex.bittrex import Bittrex, API_V2_0

my_bittrex = Bittrex(None, None, api_version=API_V2_0)
my_bittrex.get_markets()

$ ./bittrex.py Traceback (most recent call last): File "./bittrex.py", line 3, in from bittrex.bittrex import Bittrex, API_V2_0 File "/home/ubuntu/autotrade/bittrex.py", line 3, in from bittrex.bittrex import Bittrex, API_V2_0 ImportError: No module named bittrex

TalhaAsmal commented 6 years ago

Hi,

Did you install using pip into your active virtual environment?

fabius8 commented 6 years ago

Hi, Yes, I already install it. please check the log blew

➜  github pip install python-bittrex
Requirement already satisfied: python-bittrex in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages (from python-bittrex)
slazarov commented 6 years ago

What’s in your init.py?

fabius8 commented 6 years ago
➜  bittrex pwd
/usr/local/lib/python2.7/site-packages/bittrex
➜  bittrex cat __init__.py
from .bittrex import *          # noqa
➜  bittrex ls
__init__.py  __init__.pyc bittrex.py   bittrex.pyc
TalhaAsmal commented 6 years ago

Are you running it with python2 or python3? It seems you've installed it with python2, so that should be the version you use when importing bittrex.

fabius8 commented 6 years ago

I run it with python2.7. and pip version is 2.7 too.

skyl commented 6 years ago

Is it that the name of your script is bittrex.py and that is conflicting with the library name? Try to change the filename of your script to foobar.py and see if that helps.

fabius8 commented 6 years ago

Hi , I rename bittrex.py to hi_bittrex.py, It is OK now! thank you very much!