jcamiloangarita/stocker

json.decoder.JSONDecodeError:

dnkls opened this issue · 3 comments

dnkls commented

I keep getting this error every time ☹️

`2021-10-26 02:10:24.399589: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-10-26 02:10:24.399916: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
[*********************100%***********************]  1 of 1 completed
Traceback (most recent call last):
  File "C:\Users\xans0\Desktop\TgTwitterStreamer\Stock\stock.py", line 9, in <module>
    correlation(stocks, interest=True, wiki_views=True, indicators=True)
  File "C:\Users\xans0\Desktop\TgTwitterStreamer\venv\lib\site-packages\stocker\get_data.py", line 135, in correlation
    df = total(stock, years, interest, wiki_views, indicators, period)
  File "C:\Users\xans0\Desktop\TgTwitterStreamer\venv\lib\site-packages\stocker\get_data.py", line 114, in total
    company = company_name(stock)  # get the name of the company
  File "C:\Users\xans0\Desktop\TgTwitterStreamer\venv\lib\site-packages\stocker\get_data.py", line 18, in company_name
    company = requests.get(url).json()['ResultSet']['Result'][0]['name']   # saving the name as 'company'
  File "C:\Users\xans0\Desktop\TgTwitterStreamer\venv\lib\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\xans0\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\xans0\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\xans0\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Process finished with exit code 1
`

I'm also having the same problems on Python 3.7.x

I am also seeing this issue in Python 3.9.7

>>> import stocker
>>> stocker.predict.tomorrow('AAPL')
[*********************100%***********************]  1 of 1 completed
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/andrewgonzalez/.virtualenvs/test/lib/python3.9/site-packages/stocker/predict.py", line 28, in tomorrow
    stock_data = total(stock, years=years, interest='Interest' in features, wiki_views='Wiki_views' in features,
  File "/Users/andrewgonzalez/.virtualenvs/test/lib/python3.9/site-packages/stocker/get_data.py", line 114, in total
    company = company_name(stock)  # get the name of the company
  File "/Users/andrewgonzalez/.virtualenvs/test/lib/python3.9/site-packages/stocker/get_data.py", line 18, in company_name
    company = requests.get(url).json()['ResultSet']['Result'][0]['name']   # saving the name as 'company'
  File "/Users/andrewgonzalez/.virtualenvs/test/lib/python3.9/site-packages/requests/models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

There was an issue related to the function for translating the stock symbol to a proper company name for checking the general interest. A fix was already pushed and there's a new version (v0.1.11).

The issue should be solved now, feel free to test it and open a new ticket if something else arise.