简体   繁体   English

Paperboy 抛出错误:TypeError:JSON 对象必须是 str,而不是“字节”?

[英]Paperboy throwing error: TypeError: the JSON object must be str, not 'bytes'?

I have installed paperboy using steps given at https://github.com/timkpaine/paperboy.git我已经使用https://github.com/timkpaine/paperboy.git给出的步骤安装了paperboy

and executed using并使用

python3 -m paperboy

while uploading notebook from UI从 UI 上传笔记本时

在此处输入图片说明

when click on the save button UI not responding but throwing below error on console当单击保存按钮 UI 没有响应但在控制台上抛出以下错误时

CRITICAL:root:list : <class 'paperboy.storage.sqla.models.report.ReportSQL'>, result : 0 - 0 [2019-12-03 15:26:01 +0530] [24991] [ERROR] Error handling request /api/v1/notebooks?action=save Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/sync.py", line 135, in handle self.handle_request(listener, req, client, addr) File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/sync.py", line 176, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/usr/local/lib/python3.5/dist-packages/falcon/api.py", line 244, in __call__ responder(req, resp, **params) File "/home/exa00112/xstream/paperboy/paperboy/resources/notebook.py", line 21, in on_post resp.body = json.dumps(self.db.notebooks.store(req.context['user'], req.params, self.session)) File "/home/exa00112/xstream/paperboy/paperboy/storage/sqla/notebook.py", line 44, in store notebook = nbformat.writes(strip_outputs(nbformat.reads(params.get('file').file.read(), 4))) File "/usr/local/lib/python3.5/dist-packages/nbformat/__init__.py", line 74, in reads nb = reader.reads(s, **kwargs) File "/usr/local/lib/python3.5/dist-packages/nbformat/reader.py", line 58, in reads nb_dict = parse_json(s, **kwargs) File "/usr/local/lib/python3.5/dist-packages/nbformat/reader.py", line 14, in parse_json nb_dict = json.loads(s, **kwargs) File "/usr/lib/python3.5/json/__init__.py", line 312, in loads s.__class__.__name__)) TypeError: the JSON object must be str, not 'bytes'

Use a master branch to install paperboy https://github.com/timkpaine/paperboy.git使用 master 分支安装 paperboy https://github.com/timkpaine/paperboy.git

git clone https://github.com/timkpaine/paperboy.git
cd paperboy
conda create --name python3.7 python=3.7
conda activate python3.7
npm install
npm run build
pip install -e .

then open然后打开

paperboy/server/deploy_nix.py

change line number 2 with将第 2 行更改为

from six import iteritems #from gunicorn.six import iteritems

then run然后运行

python -m paperboy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型错误:JSON 对象必须是 str,而不是 &#39;bytes&#39; - TypeError: the JSON object must be str, not 'bytes' 给出错误“JSON对象必须是str,而不是&#39;bytes&#39;” - Giving error “the JSON object must be str, not 'bytes' ” httplib2.Http()-TypeError:JSON对象必须为str,而不是“ bytes” - httplib2.Http() - TypeError: the JSON object must be str, not 'bytes' TypeError:JSON对象必须为str,而不是Jupyter笔记本上的“ bytes” - TypeError: the JSON object must be str, not 'bytes' on Jupyter notebook only Django 获取 TypeError:JSON 对象必须是 str、bytes 或 bytearray,而不是 dict - Django get TypeError: the JSON object must be str, bytes or bytearray, not dict Python 3 类型错误:JSON object 必须是 str、bytes 或 bytearray,而不是 Tag - Python 3 TypeError: the JSON object must be str, bytes or bytearray, not Tag TypeError:必须是str,而不是字节Error - TypeError: must be str, not bytes Error 解析DRF请求主体:TypeError JSON对象必须是str,而不是'bytes' - Parsing DRF request body: TypeError the JSON object must be str, not 'bytes' JSON对象必须为str,而不是“ bytes” - the JSON object must be str, not 'bytes' TypeError:JSON对象必须是str,而不是&#39;bytes&#39; - Python - fixer.io - TypeError: the JSON object must be str, not 'bytes' - Python - fixer.io
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM