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

Client #10

Closed
PLAYER69 opened this issue Jul 29, 2020 · 7 comments
Closed

Client #10

PLAYER69 opened this issue Jul 29, 2020 · 7 comments

Comments

@PLAYER69
Copy link

Hi. I just did a pip install on pip install finnhub-python. While I can run

import finnhub

When calling finnhub_client = finnhub.Client(api_key="bs5dfjvrh5rfj3oth1ag")

complains AttributeError: module 'finnhub' has no attribute 'Client'

Has something changed in the call?

@nongdenchet
Copy link
Contributor

Hi @PLAYER69 I can execute it just fine.

  1. Can you check what is the version of finnhub-python on your machine via pip show finnhub-python? Make sure you have the latest version which is 2.0.0.
  2. Try to uninstall and install again if you don't have the latest version.

@PLAYER69
Copy link
Author

PLAYER69 commented Jul 31, 2020 via email

@nongdenchet
Copy link
Contributor

I am closing this issue now. If you need more helps, let's us know

@fijiaaron
Copy link

I'm seeing what appears to be this same issue again with finnhub-python 2.4.0

Here is the simple script I'm running

(finnhub) aaronevans@macbook:finnhub $ cat finnhub.py 
import finnhub
import os

# Setup client
FINNHUB_API_KEY = os.environ.get('FINNHUB_API_KEY')
finnhub_client = finnhub.Client(api_key=FINNHUB_API_KEY)

# Stock candles
res = finnhub_client.stock_candles('AAPL', 'D', 1590988249, 1591852249)
print(res)
(finnhub) aaronevans@macbook:finnhub $ python finnhub.py
Traceback (most recent call last):
  File "finnhub.py", line 1, in <module>
    import finnhub
  File "/Users/aaronevans/scratch/finnhub/finnhub.py", line 6, in <module>
    finnhub_client = finnhub.Client(api_key=FINNHUB_API_KEY)
AttributeError: partially initialized module 'finnhub' has no attribute 'Client' (most likely due to a circular import)

(finnhub) aaronevans@macbook:finnhub $ pip show finnhub-python
Name: finnhub-python
Version: 2.4.0
Summary: Finnhub API
Home-page: https://finnhub.io/docs/api
Author: Finnhub
Author-email: support@finnhub.io
License: Apache-2.0
Location: /Users/aaronevans/.pyenv/versions/3.8.2/envs/finnhub/lib/python3.8/site-packages
Requires: requests
Required-by: 
(finnhub) aaronevans@macbook:finnhub $ pip freeze
certifi==2020.12.5
chardet==4.0.0
finnhub-python==2.4.0
idna==2.10
requests==2.25.1
urllib3==1.26.3

Am I doing something wrong?

@fijiaaron
Copy link

Nevermind, I see my error -- my file is named finnhub.py and it's trying to import that

@trailblazn
Copy link

Nevermind, I see my error -- my file is named finnhub.py and it's trying to import that

This helped me, thanks!

@Tedmcm
Copy link

Tedmcm commented Sep 2, 2021

Hi, Im having the same issue but cant uninstall it. I installed today with the updated pip install for the newest version but it wont install that version and i cant find/get any uninstall to work?

Screen Shot 2021-09-02 at 3 35 45 PM

Screen Shot 2021-09-02 at 3 37 46 PM

I cant find any commands to let me install a specific version or update the version i have? it wont let me use .Client or any of the calls? Can you give me the uninstall/install commands? im using the lastest ones from
(https://pypi.org/project/finnhub-python/). and it only installs the old version??

I found where to change the version but it still doenst not work...

Screen Shot 2021-09-02 at 3 43 38 PM

I get the same errors.. no .Client

Screen Shot 2021-09-02 at 3 44 45 PM

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

No branches or pull requests

5 participants