-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Zipline Jsondecoder error #2669
Comments
i tried on two machines and error exists |
I can confirm this, I have the same error in a similar setup. Bests, |
so pitty zipline is such a powerful yet painful library. |
check this #2480 , it is related a SPY benchmark API download. |
thank you for sharing the answer, I did the changed to the benchmark but no luck! didn't work! |
what change you have made? |
Hi all, I'm going to close this in favor of the consolidated issue for the benchmark downloading problems: #2627. #2642 should help now, if you're using master, but it isn't released on PyPI yet. Feel free to ping there or to reopen this if you think there's information in this issue that's not captured in the other one. |
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
$ uname --all
)3.5.6
pip
,conda
, or `other (please explain)Installed as a new environment with python3.5.6 in anaconda then run
conda install -c quantopian zipline
$ pip freeze
or$ conda list
alembic == 0.7.7
asn1crypto == 0.24.0
bcolz == 0.12.1
blas == 1
bleach == 3.1.0
blosc == 1.16.3
bottleneck == 1.2.1
bzip2 == 1.0.8
ca-certificates == 2020.1.1
certifi == 2018.8.24
cffi == 1.11.5
chardet == 3.0.4
click == 7
colorama == 0.4.3
contextlib2 == 0.6.0.post1
cryptography == 2.3.1
cycler == 0.10.0
cyordereddict == 0.2.2
cython == 0.28.5
decorator == 4.4.2
defusedxml == 0.6.0
empyrical == 0.5.0
entrypoints == 0.2.3
future == 0.16.0
hdf5 == 1.10.2
icc_rt == 2019.0.0
idna == 2.7
intel-openmp == 2019.4
intervaltree == 2.1.0
ipykernel == 4.10.0
ipython == 5.8.0
ipython_genutils== 0.2.0
jinja2 == 2.11.1
json5 == 0.9.1
jsonschema == 2.6.0
jupyter_client == 5.3.3
jupyter_core == 4.5.0
kiwisolver == 1.1.0
libiconv == 1.15
libsodium == 1.0.16
libxml2 == 2.9.9
libxslt == 1.1.33
logbook == 0.12.5
lru-dict == 1.1.4
lxml == 4.2.5
lz4-c == 1.8.1.2
lzo == 2.1
m2w64-gcc-libgfortran == 5.3.0
m2w64-gcc-libs == 5.3.0
m2w64-gcc-libs-core == 5.3.0
m2w64-gmp == 6.1.0
m2w64-libwinpthread-git== 5.0.0.4634.69
mako == 1.1.2
markupsafe == 1
matplotlib == 3.0.3
mistune == 0.8.3
mkl == 2018.0.3
msys2-conda-epoch == 20160418
multipledispatch == 0.6.0
nbconvert == 5.5.0
nbformat == 5.0.4
networkx == 1.11
notebook == 5.6.0
numexpr == 2.6.1
numpy == 1.14.2
openssl == 1.0.2u
pandas == 0.22.0
pandas-datareader == 0.8.1
pandoc == 2.2.3.2
pandocfilters == 1.4.2
patsy == 0.5.0
pickleshare == 0.7.4
pip == 20.0.2
prometheus_client == 0.7.1
prompt_toolkit == 1.0.15
pycparser == 2.19
pygments == 2.5.2
pyjson == 1.3.0
pyopenssl == 18.0.0
pyparsing == 2.4.6
pypiwin32 == 223
pysocks == 1.6.8
pytables == 3.4.4
python == 3.5.6
python-dateutil == 2.8.1
python-jsonrpc-server == 0.3.4
pytz == 2019.3
pywin32 == 227
pywinpty == 0.5.4
pyzmq == 17.1.2
requests == 2.20.1
requests-file == 1.4.3
scipy == 1.1.0
send2trash == 1.5.0
setuptools == 40.2.0
simplegeneric == 0.8.1
six == 1.11.0
snappy == 1.1.7
sortedcontainers == 1.4.4
sqlalchemy == 1.2.11
statsmodels == 0.9.0
terminado == 0.8.1
testpath == 0.4.4
toolz == 0.10.0
tornado == 5.1.1
trading-calendars == 1.11.1
traitlets == 4.3.2
ujson == 1.35
urllib3 == 1.23
vc == 14.1
vs2015_runtime == 14.16.27012
wcwidth == 0.1.8
webencodings == 0.5.1
wheel == 0.31.1
win_inet_pton == 1.0.1
win_unicode_console == 0.5
wincertstore == 0.2
winpty == 0.4.3
xmltodict == 0.12.0
xz == 5.2.4
zeromq == 4.2.5
zipline == 1.3.0
zlib == 1.2.11
zstd == 1.3.7
Now that you know a little about me, let me tell you about the issue I am
having: *** Error : JSONDecodeError: Expecting value: line 1 column 1 (char 0)***
code from Trading Evolved book
Description of Issue
Error : JSONDecodeError: Expecting value: line 1 column 1 (char 0)
C:\Anaconda3\envs\zipenv\lib\json\decoder.py in raw_decode(self, s, idx)
355 obj, end = self.scan_once(s, idx)
356 except StopIteration as err:
--> 357 raise JSONDecodeError("Expecting value", s, err.value) from None
358 return obj, end
I get this error:
JSONDecodeError Traceback (most recent call last)
in ()
----> 1 results= run_algorithm(start=start_date,end=end_date,initialize=initialize,analyze=analyze,handle_data=handle_data,capital_base=10000,data_frequency="daily")
C:\Anaconda3\envs\zipenv\lib\site-packages\zipline\utils\run_algo.py in run_algorithm(start, end, initialize, capital_base, handle_data, before_trading_start, analyze, data_frequency, data, bundle, bundle_timestamp, trading_calendar, metrics_set, default_extension, extensions, strict_extensions, environ, blotter)
428 local_namespace=False,
429 environ=environ,
--> 430 blotter=blotter,
431 )
C:\Anaconda3\envs\zipenv\lib\site-packages\zipline\utils\run_algo.py in _run(handle_data, initialize, before_trading_start, analyze, algofile, algotext, defines, data_frequency, capital_base, data, bundle, bundle_timestamp, start, end, output, trading_calendar, print_algo, metrics_set, local_namespace, environ, blotter)
157 trading_calendar=trading_calendar,
158 trading_day=trading_calendar.day,
--> 159 trading_days=trading_calendar.schedule[start:end].index,
160 )
161 first_trading_day =\
C:\Anaconda3\envs\zipenv\lib\site-packages\zipline\finance\trading.py in init(self, load, bm_symbol, exchange_tz, trading_calendar, trading_day, trading_days, asset_db_path, future_chain_predicates, environ)
101 trading_day,
102 trading_days,
--> 103 self.bm_symbol,
104 )
105
C:\Anaconda3\envs\zipenv\lib\site-packages\zipline\data\loader.py in load_market_data(trading_day, trading_days, bm_symbol, environ)
147 # date so that we can compute returns for the first date.
148 trading_day,
--> 149 environ,
150 )
151 tc = ensure_treasury_data(
C:\Anaconda3\envs\zipenv\lib\site-packages\zipline\data\loader.py in ensure_benchmark_data(symbol, first_date, last_date, now, trading_day, environ)
214
215 try:
--> 216 data = get_benchmark_returns(symbol)
217 data.to_csv(get_data_filepath(filename, environ))
218 except (OSError, IOError, HTTPError):
C:\Anaconda3\envs\zipenv\lib\site-packages\zipline\data\benchmarks.py in get_benchmark_returns(symbol)
33 'https://api.iextrading.com/1.0/stock/{}/chart/5y'.format(symbol)
34 )
---> 35 data = r.json()
36
37 df = pd.DataFrame(data)
C:\Anaconda3\envs\zipenv\lib\site-packages\requests\models.py in json(self, **kwargs)
895 # used.
896 pass
--> 897 return complexjson.loads(self.text, **kwargs)
898
899 @Property
C:\Anaconda3\envs\zipenv\lib\json_init_.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
317 parse_int is None and parse_float is None and
318 parse_constant is None and object_pairs_hook is None and not kw):
--> 319 return _default_decoder.decode(s)
320 if cls is None:
321 cls = JSONDecoder
C:\Anaconda3\envs\zipenv\lib\json\decoder.py in decode(self, s, _w)
337
338 """
--> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
340 end = _w(s, end).end()
341 if end != len(s):
C:\Anaconda3\envs\zipenv\lib\json\decoder.py in raw_decode(self, s, idx)
355 obj, end = self.scan_once(s, idx)
356 except StopIteration as err:
--> 357 raise JSONDecodeError("Expecting value", s, err.value) from None
358 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Here is how you can reproduce this issue on your machine:
Reproduction Steps
What steps have you taken to resolve this already?
I installed a number of json libs hoping it will take care of that error
...
Sincerely,
$ Reza
The text was updated successfully, but these errors were encountered: