gpt4 book ai didi

python - 无输出 - Jupyter Notebook

转载 作者:行者123 更新时间:2023-12-05 04:01:48 26 4
gpt4 key购买 nike

首先,我使用 MacOSX 和 chrome 浏览器。

执行简单的打印语句时,我无法读取任何输出。

我首先创建一个名为“hello.py”的简单文件

print("hola")

然后我使用 jupytext 将其转换为 ipython 笔记本格式

jupytext --to notebook hello.py

然后我运行了 jupyter notebook,但是我没有收到任何输出。

我尝试了各种方法,例如 Print not showing in ipython notebook .

根据别处的评论,* 表示它正在处理。我给了它足够的时间,它只是一个简单的打印语句,应该立即处理。

enter image description here

可能有用的附加信息。文件

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
numpy = "*"
matplotlib = "*"
pytest = "*"
setuptools = "*"
cycler = "*"
kiwisolver = "*"
pyparsing = "*"
jupyter = "*"
ipython = "*"
nbformat = "*"
jupytext = "*"
jupyter-kernel-gateway = "*"

[requires]
python_version = "3.7"

jupyter troubleshoot 的输出

$PATH:
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/bin
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/bin
/Users/harvest/.yarn/bin
/Users/harvest/.config/yarn/global/node_modules/.bin
/Users/harvest/.pyenv/shims
/Users/harvest/.nodenv/shims
/Users/harvest/.rbenv/shims
/Users/harvest/bin
/usr/local/bin
/usr/local/Cellar/pipenv/2018.11.26_1/libexec/tools
/Users/harvest/.yarn/bin
/Users/harvest/.config/yarn/global/node_modules/.bin
/Users/harvest/.pyenv/shims
/Users/harvest/.nodenv/shims
/Users/harvest/.rbenv/shims
/Users/harvest/bin
/usr/local/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/Frameworks/Mono.framework/Versions/Current/Commands
/Applications/Postgres.app/Contents/Versions/latest/bin
/Users/harvest/.composer/vendor/bin
/Users/harvest/.composer/vendor/bin

sys.path:
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/bin
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/lib/python37.zip
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/lib/python3.7
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/lib/python3.7/lib-dynload
/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/lib/python3.7/site-packages

sys.executable:
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/bin/python3.7

sys.version:
3.7.2 (default, Jan 13 2019, 12:50:01)
[Clang 10.0.0 (clang-1000.11.45.5)]

platform.platform():
Darwin-18.2.0-x86_64-i386-64bit

which -a jupyter:
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/bin/jupyter
/Users/harvest/.local/share/virtualenvs/make-your-own-neural-network-3AgNnsP-/bin/jupyter

pip list:
Package Version
---------------------- -----------
appnope 0.1.0
atomicwrites 1.3.0
attrs 19.1.0
backcall 0.1.0
bleach 3.1.0
certifi 2018.11.29
chardet 3.0.4
cycler 0.10.0
decorator 4.3.2
defusedxml 0.5.0
entrypoints 0.3
freetype-py 2.0.0.post6
idna 2.8
ipykernel 5.1.0
ipython 7.3.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
jedi 0.13.3
Jinja2 2.10
jsonschema 3.0.1
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-core 4.4.0
jupyter-kernel-gateway 2.2.0
jupytext 1.0.2
kiwisolver 1.0.1
MarkupSafe 1.1.1
matplotlib 3.0.3
mistune 0.8.4
mock 2.0.0
more-itertools 6.0.0
nbconvert 5.4.1
nbformat 4.4.0
notebook 5.7.4
numpy 1.16.2
pandocfilters 1.4.2
parso 0.3.4
pbr 5.1.3
pexpect 4.6.0
pickleshare 0.7.5
pip 19.0.3
pluggy 0.9.0
prometheus-client 0.6.0
prompt-toolkit 2.0.9
ptyprocess 0.6.0
py 1.8.0
Pygments 2.3.1
pyparsing 2.3.1
pyrsistent 0.14.11
pytest 4.3.0
python-dateutil 2.8.0
PyYAML 3.13
pyzmq 18.0.0
qtconsole 4.4.3
requests 2.21.0
Send2Trash 1.5.0
setuptools 40.8.0
six 1.12.0
terminado 0.8.1
testfixtures 6.6.0
testpath 0.4.2
tornado 6.0
traitlets 4.3.2
urllib3 1.24.1
wcwidth 0.1.7
webencodings 0.5.1
wheel 0.33.1
widgetsnbextension 3.4.2

最佳答案

我能够通过卸载 tornado 6 并安装 tornado 5 来解决这个问题。

5.1.1 是最后一个稳定版本,解决了我的问题。

引用自Jupyter notebook: No connection to server because websocket connection fails

关于python - 无输出 - Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54971836/

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