Initial import not working
romanme2 opened this issue · comments
Hi,
I installed the latest myeia package and followed the initial prompts and getting an error. Please advise. Thanks!!
Here is my code:
from myeia.api import API
eia = api.API(token='*****')
Error:
ImportError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_31796\2078088430.py in
----> 1 from myeia.api import API
2
3 eia = api.API(token='*****')
~\Anaconda3\lib\site-packages\myeia\api.py in
7 import requests
8 from dotenv import load_dotenv
----> 9 from pandas.errors import SettingWithCopyWarning
10
11 warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
ImportError: cannot import name 'SettingWithCopyWarning' from 'pandas.errors' (C:\Users\mlr\Anaconda3\lib\site-packages\pandas\errors_init_.py)
Sorry about that, I will be back on my laptop by monday. I will have a look at the issue then.
What version of pandas are you using? You can check by typing pip list
in your cmd
I am using Pandas 1.4.4
I updated to the latest Pandas package but now get an error running your code. I double checked my API token, let me know what you think.
SLError: HTTPSConnectionPool(host='api.eia.gov', port=443): Max retries exceeded with url: /v2/seriesid/STEO.PAPR_OPEC.M?api_key=********(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
What python version do you use? Could be the python version you use, or has do something with requests, urllib3 or certifi
I tested myeia on a clean venv and it worked out both on windows or linux systems.
This might help you: https://stackoverflow.com/questions/35569042/ssl-certificate-verify-failed-with-python3
You might want to first update some packages or switch to a higher python version before you try to disable SSL verification. Or wait some hours, before you try to run the code again. You might exceeded some API limits. Its not really recommended to disable SSL verification or to manually install a self-signed certificate.
Thank you that worked!