Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import CoinAPIv1 with Python #93

Closed
tionebrr opened this issue Feb 23, 2021 · 3 comments
Closed

Cannot import CoinAPIv1 with Python #93

tionebrr opened this issue Feb 23, 2021 · 3 comments
Assignees

Comments

@tionebrr
Copy link

tionebrr commented Feb 23, 2021

Hello folks,

Here is my commands list

cd <project>
virtualenv <project_env>
source ./<project_env>/bin/activate
pip3 install coinapi.rest.v1 # no issue here
git clone https://github.com/coinapi/coinapi-sdk/data-api/python-rest/coinapi_rest_v1
cd <coinapi-sdk/data/python/coinapi_rest_v1>
python example.py <API_KEY>

Which results in

Traceback (most recent call last): 
  File "examples.py", line 1, in <module>
    from coinapi_rest_v1 import CoinAPIv1
ImportError: cannot import name 'CoinAPIv1' from 'coinapi_rest_v1' (/home/user/Development/project/project_env/lib/python3.8

Tested on Arch (python 3.8.6) and Windows (python 3.9.0).

@tionebrr tionebrr changed the title Cannot import CoinAPIv1 with Python 3.9 Cannot import CoinAPIv1 with Python Feb 23, 2021
@Svisstack
Copy link
Contributor

Hi @tionebrr

Please try to run the examples directly from the source as the package is probably directly referenced in the examples file.

https://github.com/coinapi/coinapi-sdk/blob/master/data-api/python-rest/README.md

@Svisstack Svisstack self-assigned this Feb 23, 2021
@tionebrr
Copy link
Author

tionebrr commented Feb 23, 2021

Hi ! Thanks for the prompt answer !

What you're suggesting is what I'm trying actually (unless I'm missing something?). I'm here:

$ pwd 
/home/btrr/Development/pythonTrading/coinapi-sdk/data-api/python-rest/coinapi_rest_v1 
$ python examples.py
Traceback (most recent call last):    
  File "examples.py", line 1, in <module>  
    from coinapi_rest_v1 import CoinAPIv1 
ImportError: cannot import name 'CoinAPIv1' from 'coinapi_rest_v1' (/home/btrr/Development/pythonTradingFish/fish/lib/python3.8/site-packages/coinapi_rest_v1/__init__.py)     

I see the python-rest folder is in the data-api subfolder which does not appear in the documentation. Could that be an issue?

@tionebrr
Copy link
Author

Found a workaround here: #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants