Open Cliobuff opened 4 years ago
你好,我感觉可能跟python版本有关系。我用的python3.7.5,在win和mac都运行成功了,要不你尝试换一下3.7.5?
---原始邮件--- 发件人: "Kunyuan04"<notifications@github.com> 发送时间: 2020年6月17日(周三) 晚上7:33 收件人: "thunderhit/shreport"<shreport@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [thunderhit/shreport] 关于批量下载上海证券交易所上市公司年报的shreport代码包 (#1)
大邓博士您好!
希望您和您的家人在这段时间安好!
我是康奈尔大学的管理学博士,和您专业类似。但是不同的是您是Python专家(follow了您的GitHub主页,尤其是您的https://github.com/thunderhit/shreport是我学习的重要源泉),我属于小白一类的。看了您的BiliBili以及其他的推荐视频,获益匪浅。
但是我在运行您的数据的时候遇到了三个问题,不知道可不可以请教一下您: 1、第一个问题是使用您给的sh.py的时候,出现了: Warning (from warnings module): File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\grequests.py", line 22 curious_george.patchall(thread=False, select=False) MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See gevent/gevent#1016. Modules that had direct imports (NOT patched): ['urllib3.util (C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\util\init.py)', 'urllib3.util.ssl (C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\util\ssl_.py)'].
这个是不是因为我的版本问题,不知道如何解决。(那个Github的答案太多了,让我有点手足无措) 不知道您能不能为我指点迷津? 2、我尝试了您给的下载某上市公司年报.py,同样的问题再次出现,并且有如下的反应: 准备获取600000年报文件链接 Traceback (most recent call last): File "D:\Screenscript\shreport-master\test\下载某上市公司年报.py", line 10, in sh.download(code='600000', savepath=cwd) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shreport\sh.py", line 139, in download urls = self.pdfurls(code=code) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shreport\sh.py", line 109, in pdfurls resp = requests.get(url, headers=headers, cookies=self.cookies) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\api.py", line 76, in get return request('get', url, params=params, kwargs) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\sessions.py", line 643, in send r = adapter.send(request, kwargs) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\connectionpool.py", line 392, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1240, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1281, in _send_request self.putheader(hdr, value) File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1213, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode characters in position 7-8: ordinal not in range(256) Stackflow 上有一些回答,但是好像不是很有用。 3、最后,一个不是特不重要的,是在运行您的setup到时候,这个 unicode的问题再次出现,估计是不是我需要安装摸一个包? Traceback (most recent call last):
File "D:\Screenscript\shreport-master\setup.py", line 15, in long_description=open('README.md').read(), # 读取的Readme文档内容 UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 5: illegal multibyte sequence
谢谢您!还望您不吝赐教!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
大邓博士您好!
希望您和您的家人在这段时间安好!
我是康奈尔大学的管理学博士,和您专业类似。但是不同的是您是Python专家(follow了您的GitHub主页,尤其是您的https://github.com/thunderhit/shreport是我学习的重要源泉),我属于小白一类的。看了您的BiliBili以及其他的推荐视频,获益匪浅。
但是我在运行您的数据的时候遇到了三个问题,不知道可不可以请教一下您: 1、第一个问题是使用您给的sh.py的时候,出现了: Warning (from warnings module): File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\grequests.py", line 22 curious_george.patchall(thread=False, select=False) MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\util\init.py)', 'urllib3.util.ssl (C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\util\ssl_.py)'].
这个是不是因为我的版本问题,不知道如何解决。(那个Github的答案太多了,让我有点手足无措) 不知道您能不能为我指点迷津? 2、我尝试了您给的下载某上市公司年报.py,同样的问题再次出现,并且有如下的反应: 准备获取600000年报文件链接 Traceback (most recent call last): File "D:\Screenscript\shreport-master\test\下载某上市公司年报.py", line 10, in
sh.download(code='600000', savepath=cwd)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shreport\sh.py", line 139, in download
urls = self.pdfurls(code=code)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\shreport\sh.py", line 109, in pdfurls
resp = requests.get(url, headers=headers, cookies=self.cookies)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\api.py", line 76, in get
return request('get', url, params=params, kwargs)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\api.py", line 61, in request
return session.request(method=method, url=url, kwargs)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\sessions.py", line 530, in request
resp = self.send(prep, send_kwargs)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\sessions.py", line 643, in send
r = adapter.send(request, kwargs)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests-2.23.0-py3.8.egg\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3-1.25.9-py3.8.egg\urllib3\connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1240, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1281, in _send_request
self.putheader(hdr, value)
File "C:\Users\qiaok\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1213, in putheader
values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 7-8: ordinal not in range(256)
Stackflow 上有一些回答,但是好像不是很有用。
3、最后,一个不是特不重要的,是在运行您的setup到时候,这个 unicode的问题再次出现,估计是不是我需要安装摸一个包?
Traceback (most recent call last):
File "D:\Screenscript\shreport-master\setup.py", line 15, in
long_description=open('README.md').read(), # 读取的Readme文档内容
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 5: illegal multibyte sequence
谢谢您!还望您不吝赐教!