在 anaconda 2.7 + tushare 1.2.32 正常.
ryan@haha_data_source:~/tushare_ryan$ python
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
pro.stock_basic(exchange='', list_status='L', fields='ts_code,symbol,name,area,industry,list_date')
Traceback (most recent call last):
File "", line 1, in
File "/home/ryan/anaconda3/lib/python3.7/site-packages/tushare/pro/client.py", line 41, in query
result = json.loads(res.text)
File "/home/ryan/anaconda3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/ryan/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/ryan/anaconda3/lib/python3.7/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)
This is caused by network, looks the network disallowed the connection to tushare server. After switching to another network, the issue no longer exist.
在 anaconda 2.7 + tushare 1.2.32 正常. ryan@haha_data_source:~/tushare_ryan$ python Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org
12_25 22:04:01 http://api.tushare.pro:80 "POST / HTTP/1.1" 200 None
用annaconda 3.7 + tushare 1.2.48 出现权限错误, http 403.