gpt4 book ai didi

python - 非递归脚本中的突然递归错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:36:35 24 4
gpt4 key购买 nike

我一直在使用的脚本突然出现错误,而且没有任何意义。当我从我编写的包中调用一个函数时我得到了它(它说这是一个递归错误),但是我可以在包 main 本身中使用相同的参数调用相同的函数就好了。不涉及循环,也没有递归。

我现在也遇到了其他包的错误。

import play_scraper
print(play_scraper.details("com.whatsapp"))

这会产生:

Traceback (most recent call last):
File "C:/Users/wd/OneDrive - UGent/Python/test/test.py", line 3, in <module>
print(play_scraper.details("com.whatsapp"))
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\play_scraper\api.py", line 22, in details
return s.details(app_id)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\play_scraper\scraper.py", line 292, in details
response = send_request('GET', url)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\play_scraper\utils.py", line 120, in send_request
verify=verify)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\requests\sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\requests\sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 844, in _validate_conn
conn.connect()
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\urllib3\connection.py", line 314, in connect
cert_reqs=resolve_cert_reqs(self.cert_reqs),
File "C:\Users\wd\AppData\Roaming\Python\Python36\site-packages\urllib3\util\ssl_.py", line 265, in create_urllib3_context
context.options |= options
File "C:\Python36-32\lib\ssl.py", line 459, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\Python36-32\lib\ssl.py", line 459, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\Python36-32\lib\ssl.py", line 459, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 323 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object

显然,在我的两行脚本中不会发生任何类型的递归。我最好的猜测:我在我的 3.6.1 解释器中安装一个未识别的包时改变了一些东西,因为我在 3.5 中没有得到这个错误。可能是我安装的 play_scraper 要求之一,它们是

beautifulsoup4 (>=4.4.1)
grequests (>=0.3.0)
lxml (>=3.6.0)
requests (>=2.9.1)

不过,这几乎都是猜测。有人知道发生了什么事吗?

最佳答案

我刚刚使用来自 gunicorn gevent 环境的请求遇到了同样的错误。

这可能与: https://github.com/gevent/gevent/issues/903

根据那个问题,升级你的 gevent 版本应该可以解决问题,尽管我在 1.2.2 版本中看到了同样的错误。

关于python - 非递归脚本中的突然递归错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47353501/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com