AWS Builder Center: Learn, Build and Connect with builders in the AWS community
AWS Builder Center is the official home for builders on AWS. Share and read what others are working on, follow people who inspire you, explore training and workshops, and find tools to support what you're building.
笔记本中构造函数参数应为str类型
【以下的问题经过翻译处理】 我有一个 Python 3 Neptune Notebook。当我尝试运行诸如
结果 = g.V().has('代码','测试').valueMap().toList()
print('结果是' + str(result))
我得到:
~/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/yarl/_url.py 在新**(cls,val,编码,严格)**
156 val = urlsplit(str(val))
157 其他:
--> 158 raise TypeError("构造函数参数应该是 str")
159
160 如果没有编码:
TypeError: 构造函数参数应该是 str
这是一个新错误,这些命令在过去一年左右有效。这是我在使用 Python 3.8 而不是 3.7 调用 Neptune 时在 python 中遇到的类似错误...我可以将笔记本 Python 更改为 3.7 吗?
编辑者:ColinWithMothrazzz,2021 年 11 月 18 日 6:09 AM
在过去一周左右的时间里,为了运行笔记本,我一直在使用以下命令降级我的笔记本:
%%狂欢
aws s3 cp s3://aws-neptune-notebook/graph_notebook.tar.gz /tmp/graph_notebook.tar.gz
rm -rf /tmp/图表_notebook
tar -zxvf /tmp/graph_notebook.tar.gz -C /tmp
/tmp/graph_notebook/install.sh -v="3.0.6"
运行代码。现在我无法降级笔记本,当我尝试时得到这个:
警告:跳过 NeptuneGraphNotebook,因为它未安装。
配置选项 kernel_spec_manager_class 无法被 InstallNBExtensionApp 识别。
安装/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/gremlin_syntax/static -> gremlin_syntax
删除:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/gremlin_syntax/static/init.py -> /home /ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/init.py
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/gremlin_syntax/static/main.js -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/main.js
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/gremlin_syntax/static/description.yaml -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/description.yaml
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/gremlin_syntax/static/README.md -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/README.md
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/pycache
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/gremlin_syntax/static/pycache/init .cpython-36.pyc -> /home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/gremlin_syntax/pycache/init.cpython-36.pyc
- 验证:好的
安装/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/sparql_syntax/static -> sparql_syntax
删除:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/sparql_syntax/static/init.py -> /home /ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/init.py
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/sparql_syntax/static/main.js -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/main.js
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/sparql_syntax/static/description.yaml -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/description.yaml
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/sparql_syntax/static/README.md -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/README.md
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/pycache
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/sparql_syntax/static/pycache/init .cpython-36.pyc -> /home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/sparql_syntax/pycache/init.cpython-36.pyc
- 验证:好的
安装/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/opencypher_syntax/static -> opencypher_syntax
删除:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/opencypher_syntax/static/init.py -> /home /ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/init.py
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/opencypher_syntax/static/main.js -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/main.js
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/opencypher_syntax/static/description.yaml -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/description.yaml
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/opencypher_syntax/static/README.md -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/README.md
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/pycache
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/opencypher_syntax/static/pycache/init .cpython-36.pyc -> /home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/opencypher_syntax/pycache/init.cpython-36.pyc
- 验证:好的
安装/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/neptune_menu/static -> neptune_menu
删除:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/neptune_menu/static/init.py -> /home /ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/init.py
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/neptune_menu/static/main.js -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/main.js
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/neptune_menu/static/description.yaml -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/description.yaml
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/neptune_menu/static/README.md -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/README.md
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/pycache
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/neptune_menu/static/pycache/init .cpython-36.pyc -> /home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/neptune_menu/pycache/init.cpython-36.pyc
- 验证:好的
安装/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static -> playable_cells
删除:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static/playable_cells.css -> /home/ec2 -user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/playable_cells.css
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static/init.py -> /home /ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/init.py
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static/main.js -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/main.js
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static/description.yaml -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/description.yaml
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static/README.md -> /home/ec2-user /anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/README.md
制作目录:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/pycache
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/nbextensions/playable_cells/static/pycache/init .cpython-36.pyc -> /home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/playable_cells/pycache/init.cpython-36.pyc
- 验证:好的
**每次加载笔记本(或其他应用程序)时在浏览器中初始化此 nbextension:**
**jupyter nbextension 启用 graph_notebook.nbextensions --py --sys-prefix**
配置选项 kernel_spec_manager_class 无法被 EnableNBExtensionApp 识别。
启用笔记本扩展 gremlin_syntax/main...
- 验证:好的
启用笔记本扩展 sparql_syntax/main...
- 验证:好的
启用笔记本扩展 opencypher_syntax/main...
- 验证:好的
启用笔记本扩展 neptune_menu/main...
- 验证:好的
启用笔记本扩展 playable_cells/main...
- 验证:好的
配置选项 kernel_spec_manager_class 无法被 InstallNBExtensionApp 识别。
安装/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/widgets/nbextension/static -> graph_notebook_widgets
过期:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/graph_notebook_widgets/init.py
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/widgets/nbextension/static/init.py -> /home/ec2 -user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/graph_notebook_widgets/init.py
最新:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/graph_notebook_widgets/extension.js
最新:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/graph_notebook_widgets/index.js
过时:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/graph_notebook_widgets/pycache/init.cpython-36.pyc
复制:/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/graph_notebook/widgets/nbextension/static/pycache/init.cpython -36.pyc -> /home/ec2-user/anaconda3/envs/JupyterSystemEnv/share/jupyter/nbextensions/graph_notebook_widgets/pycache/init.cpython-36.pyc
- 验证:好的
**每次加载笔记本(或其他应用程序)时在浏览器中初始化此 nbextension:**
**jupyter nbextension 启用 graph_notebook.widgets --py --sys-prefix**
配置选项 kernel_spec_manager_class 无法被 EnableNBExtensionApp 识别。
启用笔记本扩展图_notebook_widgets/扩展...
- 验证:好的
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python: 没有名为 graph_notebook.start_notebook 的模块
DeprecationWarning:'source deactivate' 已弃用。使用“畅达停用”。
- 主题
- 数据库
- 语言
- 中文 (简体)
- 最新
- 投票最多
- 评论最多
【以下的回答经过翻译处理】 你能尝试从“发送请求”部分中删除之前添加的nest_asyncio.apply()调用吗?目前我们回到使用Tornado HttpClient而不是AIOHTTP,所以我们此时不应该需要它,而且我不确定它可能导致什么副作用。
另外,你能在一个空的单元格中通过运行“!pip list”获取依赖项列表,并发布结果吗?
