darknet-ocr icon indicating copy to clipboard operation
darknet-ocr copied to clipboard

不管什么图片,都提示异常

Open ahghygy opened this issue 5 years ago • 7 comments

127.0.0.1:48050 - - [14/Jan/2020 18:12:47] "HTTP/1.1 POST /text" - 500 Internal Server Error Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 289, in process return self.handle() File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 280, in handle return self._delegate(fn, self.fvars, args) File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 530, in _delegate return handle_class(cls) File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 508, in handle_class return tocall(*args) File "app.py", line 66, in POST data = json.loads(data) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

127.0.0.1:48236 - - [14/Jan/2020 18:13:35] "HTTP/1.1 POST /text" - 500 Internal Server Error

ahghygy avatar Jan 14 '20 10:01 ahghygy

Screenshot from 2020-01-14 19-05-34

ahghygy avatar Jan 14 '20 11:01 ahghygy

把web.py卸载掉,重新安装。 我之前也遇到过,是版本问题。

deeroad avatar Jan 14 '20 23:01 deeroad

我一斤多次卸载重装了,还是不行啊。你有什么好的安装方法吗?

$ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple web.py --user Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing /home/ubuntu/.cache/pip/wheels/66/56/41/0afd04dbdf7cc978f28f69f7c33b488b2c62ef14980345bc38/web.py-0.40-cp35-none-any.whl Requirement already satisfied: cheroot in /home/ubuntu/.local/lib/python3.5/site-packages (from web.py) (8.2.1) Requirement already satisfied: markdown in /usr/local/lib/python3.5/dist-packages (from web.py) (3.1.1) Requirement already satisfied: jaraco.functools in /home/ubuntu/.local/lib/python3.5/site-packages (from cheroot->web.py) (2.0) Requirement already satisfied: more-itertools>=2.6 in /home/ubuntu/.local/lib/python3.5/site-packages (from cheroot->web.py) (8.1.0) Requirement already satisfied: six>=1.11.0 in /home/ubuntu/.local/lib/python3.5/site-packages (from cheroot->web.py) (1.13.0) Requirement already satisfied: setuptools>=36 in /usr/local/lib/python3.5/dist-packages (from markdown->web.py) (41.2.0) Installing collected packages: web.py Successfully installed web.py-0.40

ahghygy avatar Jan 15 '20 01:01 ahghygy

字符串编码问题

sxjpage avatar Jan 15 '20 02:01 sxjpage

python=3.6,python3.5 json.loads是字符串不是字节,要先转码

wenlihaoyu avatar Jan 15 '20 04:01 wenlihaoyu

我也遇到了这个问题 web.py框架不支持python 3.7需要把python版本更换为3.6 这个问题就解决了

jolyi-max avatar Jan 15 '20 09:01 jolyi-max

多谢大神,我升级到Python3.6 试一下

ahghygy avatar Jan 16 '20 09:01 ahghygy