由于连接超时,无法启动内核-VS代码中的Jupyter和Python



问题

我目前在Jupyter笔记本中运行Python代码时使用的虚拟环境存在问题。在让这个项目打开一个星期之后,我现在什么都不能运行了。VS代码试图激活venv,然后指示它无法到达内核:

Failed to start the Kernel. 
Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter log for further details.

在VSCode中选择适当的环境。如有必要,我在下面附上了Jupyter日志。

环境

  • VS代码1.72.0
  • Mac
  • Jupyter扩展版本:2022.9.1002791758
  • Python扩展版本:2022.16.0
  • Python 3.10.6
  • 虚拟环境Venv

尝试解决它

这种情况已经发生过一次了,我能够通过创建一个新的供应商来解决这个问题。然而,我希望找到一个最终的解决方案。

我已经卸载并重新安装了所有的jupyter软件包。我还更新了我所有的pip软件包。我已经检查过ipykernel是否全部存在,它就是6.16.0版本。和以前的许多人一样,我在关闭VS代码的外部终端中尝试过以下操作:

python -m pip install 'traitlets==4.3.3' --force-reinstall

这不起作用。除了创建依赖冲突之外,它对这个问题没有任何影响,因为Jupyter仍然无法启动内核。我还试图将龙卷风恢复到5.1.1,因为在某些情况下,它似乎是这个问题的一部分,也没有改变任何事情。

编辑nº1

根据MingJie MSFT的评论,我查看了ipykernel包的设置。我正在不同的文件夹中运行几个venv,并且包的文档指示";如果您想为不同的virtualenv或conda环境拥有多个IPython内核,则需要为内核指定唯一的名称";。我没有这样做,所以我使用--display-name.venv2虚拟环境添加显示名称"Python (.venv2)"

在许多情况下,这似乎已经解决了问题,因为内核不再有问题了。我使用了这个命令:

source .venv2/bin/activate
python -m ipykernel install --user --name .venv2 --display-name "Python (.venv2)"

我仍然需要研究两种影响。首先,我的细胞运行时间要长得多。其次,它们中的一些根本不起作用,显然是那些依赖Plotly的。我认为这与我的Python代码本身、我的pip包以及我的文件夹在云上的事实有关,可能存在同步问题。这是另一个问题,所以我会在其他地方解决。

Pip软件包

Package              Version
-------------------- -----------
appnope              0.1.3
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
asttokens            2.0.8
attrs                22.1.0
backcall             0.2.0
beautifulsoup4       4.11.1
bleach               5.0.1
cffi                 1.15.1
contourpy            1.0.5
cycler               0.11.0
DateTime             4.7
debugpy              1.6.3
decorator            5.1.1
defusedxml           0.7.1
entrypoints          0.4
et-xmlfile           1.1.0
executing            1.1.0
fastjsonschema       2.16.2
fonttools            4.37.4
ipykernel            6.16.0
ipython              8.5.0
ipython-genutils     0.2.0
ipywidgets           8.0.2
jedi                 0.18.1
Jinja2               3.1.2
jsonschema           4.16.0
jupyter              1.0.0
jupyter_client       7.3.5
jupyter-console      6.4.4
jupyter-core         4.11.1
jupyterlab-pygments  0.2.2
jupyterlab-widgets   3.0.3
kiwisolver           1.4.4
lxml                 4.9.1
MarkupSafe           2.1.1
matplotlib           3.6.0
matplotlib-inline    0.1.6
mistune              2.0.4
nbclient             0.7.0
nbconvert            7.2.1
nbformat             5.6.1
nest-asyncio         1.5.6
notebook             6.4.12
numpy                1.23.3
openpyxl             3.0.10
packaging            21.3
pandas               1.5.0
pandocfilters        1.5.0
parso                0.8.3
pexpect              4.8.0
pickleshare          0.7.5
Pillow               9.2.0
pip                  22.2.2
pip-review           1.2.0
plotly               5.10.0
prometheus-client    0.14.1
prompt-toolkit       3.0.31
psutil               5.9.2
ptyprocess           0.7.0
pure-eval            0.2.2
pycparser            2.21
Pygments             2.13.0
pyparsing            3.0.9
pyrsistent           0.18.1
python-dateutil      2.8.2
pytz                 2022.4
pyzmq                24.0.1
qtconsole            5.3.2
QtPy                 2.2.1
Send2Trash           1.8.0
setuptools           65.4.1
six                  1.16.0
soupsieve            2.3.2.post1
stack-data           0.5.1
tenacity             8.1.0
terminado            0.16.0
tinycss2             1.1.1
tornado              6.2
traitlets            5.4.0
wcwidth              0.2.5
webencodings         0.5.1
wheel                0.37.1
widgetsnbextension   4.0.3
zope.interface       5.4.0

Jupyter日志

Visual Studio Code (1.72.0, undefined, desktop)
Jupyter Extension Version: 2022.9.1002791758.
Python Extension Version: 2022.16.0.
Workspace folder /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD
info 13:31:50.908: ZMQ install verified.
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 13:31:51.260: LSP Notebooks experiment is enabled
info 13:31:52.245: Starting Jupyter Session startUsingPythonInterpreter, .jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher (Python Path: /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2, EnvType: Venv, EnvName: '.venv2', Version: 3.10.6) for '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb' (disableUI=true)
info 13:31:52.245: Computing working directory for resource '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb'
info 13:31:52.268: Preferred Remote kernel for /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb is undefined
info 13:31:53.343: Preferred Remote kernel for /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb is undefined
info 13:31:53.344: Find preferred kernel for /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb with metadata {"kernelspec":{"display_name":"Python 3.10.6 ('.venv2': venv)","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.10.6"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"73b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842"}}} & preferred interpreter 
info 13:31:53.345: Preferred Remote kernel for /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb is undefined
info 13:31:53.345: Preferred kernel .jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher is exact match or top match for non python kernels, (false, undefined, true, false)
info 13:31:53.346: PreferredConnection: .jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher found for NotebookDocument: /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb
info 13:31:53.372: Got env vars ourselves faster /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python with env var count 30 in 1128ms
info 13:31:53.372: Got env vars ourselves faster /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python with env var count 30 in 1121ms
info 13:31:53.372: Got env vars ourselves faster /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python with env var count 30 in 1087ms
info 13:31:53.372: Got env vars ourselves faster /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python with env var count 30 in 1087ms
info 13:31:53.375: Process Execution: > ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -m pip list
> ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -m pip list
info 13:31:53.380: Process Execution: > ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
info 13:31:53.383: Process Execution: > ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"349ea1b4-8ed3-4337-a198-27f9199872da" --shell=9007 --transport="tcp" --iopub=9009 --f=/Users/theoleschevin/Library/Jupyter/runtime/kernel-v2-455694J8M86a7sjjx.json
> ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"349ea1b4-8ed3-4337-a198-27f9199872da" --shell=9007 --transport="tcp" --iopub=9009 --f=/Users/theoleschevin/Library/Jupyter/runtime/kernel-v2-455694J8M86a7sjjx.json
info 13:31:53.383: Process Execution: cwd: ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK
cwd: ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK
info 13:31:54.224: ipykernel version & path 6.16.0, ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/lib/python3.10/site-packages/ipykernel/__init__.py for /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python
info 13:31:54.580: Got env vars with python /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python, with env var count 30 and custom env var count 0 in 2295ms
info 13:31:54.581: Got env vars with python /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python, with env var count 30 and custom env var count 0 in 2330ms
info 13:31:54.582: Got env vars with python /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python, with env var count 30 and custom env var count 0 in 2337ms
info 13:31:54.598: Got env vars with python /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python, with env var count 30 and custom env var count 0 in 2313ms
error 13:32:53.388: waitUntilUsed timed out [Error: timeout
at Timeout.<anonymous> (/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:1295264)
at listOnTimeout (node:internal/timers:559:17)
at process.processTimers (node:internal/timers:502:7)]
error 13:32:53.389: Disposing kernel process due to an error [a [Error]: Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter [log](command:jupyter.viewOutput) for further details.
at /Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193691
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at process.processTimers (node:internal/timers:502:7)
at async x.launch (/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193762)] {
category: 'timeout',
kernelConnectionMetadata: {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/temp/jupyter/kernels/python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842/kernel.json',
interpreterPath: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842',
argv: [Array],
language: 'python',
executable: 'python',
display_name: "Python 3.10.6 ('.venv2': venv)",
metadata: [Object],
env: {}
},
interpreter: {
id: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
sysPrefix: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2',
envType: 'Venv',
envName: '.venv2',
envPath: [p],
architecture: 3,
sysVersion: '3.10.6 (v3.10.6:9c7b4bd164, Aug  1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)]',
version: [Object],
displayName: "Python 3.10.6 ('.venv2': venv)",
detailedDisplayName: "Python 3.10.6 ('.venv2': venv)",
uri: [p]
},
id: '.jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher'
}
}
error 13:32:53.389: 
info 13:32:53.389: Dispose Kernel process 45633.
error 13:32:53.432: Kernel Launcher. launch, Class name = r, completed in 61181ms, has a falsy return value, Arg 1: {"kind":"startUsingPythonInterpreter","kernelSpec":{"specFile":"/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/temp/jupyter/kernels/python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842/kernel.json","interpreterPath":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python","isRegisteredByVSC":"registeredByNewVersionOfExt","name":"python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","executable":"python","display_name":"Python 3.10.6 ('.venv2': venv)","metadata":{"interpreter":{"path":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python"}},"env":{}},"interpreter":{"id":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python","sysPrefix":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2","envType":"Venv","envName":".venv2","envPath":{"$mid":1,"fsPath":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2","path":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2","scheme":"file"},"architecture":3,"sysVersion":"3.10.6 (v3.10.6:9c7b4bd164, Aug  1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)]","version":{"raw":"3.10.6","major":3,"minor":10,"patch":6,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.10.6 ('.venv2': venv)","detailedDisplayName":"Python 3.10.6 ('.venv2': venv)","uri":{"$mid":1,"fsPath":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python","external":"file:///Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles%20et%20Projet/EnnemisInterieur/BD/.venv2/bin/python","path":"/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python","scheme":"file"}},"id":".jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher"}, Arg 2: 60000, Arg 3: "~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb", Arg 4: "~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK", Arg 5: <argument cannot be serialized for logging> [a [Error]: Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter [log](command:jupyter.viewOutput) for further details.
at /Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193691
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at process.processTimers (node:internal/timers:502:7)
at async x.launch (/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193762)] {
category: 'timeout',
kernelConnectionMetadata: {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/temp/jupyter/kernels/python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842/kernel.json',
interpreterPath: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842',
argv: [Array],
language: 'python',
executable: 'python',
display_name: "Python 3.10.6 ('.venv2': venv)",
metadata: [Object],
env: {}
},
interpreter: {
id: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
sysPrefix: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2',
envType: 'Venv',
envName: '.venv2',
envPath: [p],
architecture: 3,
sysVersion: '3.10.6 (v3.10.6:9c7b4bd164, Aug  1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)]',
version: [Object],
displayName: "Python 3.10.6 ('.venv2': venv)",
detailedDisplayName: "Python 3.10.6 ('.venv2': venv)",
uri: [p]
},
id: '.jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher'
}
}
error 13:32:53.433: Failed to connect raw kernel session: Error: Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter [log](command:jupyter.viewOutput) for further details.
warn 13:32:53.437: Error occurred while trying to start the kernel, options.disableUI=false [a [Error]: Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter [log](command:jupyter.viewOutput) for further details.
at /Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193691
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at process.processTimers (node:internal/timers:502:7)
at async x.launch (/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193762)] {
category: 'timeout',
kernelConnectionMetadata: {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/temp/jupyter/kernels/python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842/kernel.json',
interpreterPath: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842',
argv: [Array],
language: 'python',
executable: 'python',
display_name: "Python 3.10.6 ('.venv2': venv)",
metadata: [Object],
env: {}
},
interpreter: {
id: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
sysPrefix: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2',
envType: 'Venv',
envName: '.venv2',
envPath: [p],
architecture: 3,
sysVersion: '3.10.6 (v3.10.6:9c7b4bd164, Aug  1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)]',
version: [Object],
displayName: "Python 3.10.6 ('.venv2': venv)",
detailedDisplayName: "Python 3.10.6 ('.venv2': venv)",
uri: [p]
},
id: '.jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher'
}
}
warn 13:32:53.438: Kernel Error, context = start [a [Error]: Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter [log](command:jupyter.viewOutput) for further details.
at /Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193691
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at process.processTimers (node:internal/timers:502:7)
at async x.launch (/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193762)] {
category: 'timeout',
kernelConnectionMetadata: {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/temp/jupyter/kernels/python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842/kernel.json',
interpreterPath: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842',
argv: [Array],
language: 'python',
executable: 'python',
display_name: "Python 3.10.6 ('.venv2': venv)",
metadata: [Object],
env: {}
},
interpreter: {
id: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
sysPrefix: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2',
envType: 'Venv',
envName: '.venv2',
envPath: [p],
architecture: 3,
sysVersion: '3.10.6 (v3.10.6:9c7b4bd164, Aug  1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)]',
version: [Object],
displayName: "Python 3.10.6 ('.venv2': venv)",
detailedDisplayName: "Python 3.10.6 ('.venv2': venv)",
uri: [p]
},
id: '.jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher'
}
}
info 13:32:53.440: Got env vars with python /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python, with env var count 30 and custom env var count 0 in 2ms
info 13:32:53.440: Got env vars ourselves faster /Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python with env var count 30 in 2ms
info 13:32:53.444: Process Execution: > ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -c "import ipykernel"
> ~/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python -c "import ipykernel"
info 13:32:53.837: Dispose Kernel '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb' associated with '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/UK/SummaryUK.ipynb'
error 13:32:53.839: Error in execution [a [Error]: Unable to start Kernel '.venv2 (Python 3.10.6)' due to connection timeout. 
View Jupyter [log](command:jupyter.viewOutput) for further details.
at /Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193691
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at process.processTimers (node:internal/timers:502:7)
at async x.launch (/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/out/extension.node.js:2:2193762)] {
category: 'timeout',
kernelConnectionMetadata: {
kind: 'startUsingPythonInterpreter',
kernelSpec: {
specFile: '/Users/theoleschevin/.vscode/extensions/ms-toolsai.jupyter-2022.9.1002791758/temp/jupyter/kernels/python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842/kernel.json',
interpreterPath: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
isRegisteredByVSC: 'registeredByNewVersionOfExt',
name: 'python3106jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842',
argv: [Array],
language: 'python',
executable: 'python',
display_name: "Python 3.10.6 ('.venv2': venv)",
metadata: [Object],
env: {}
},
interpreter: {
id: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/bin/python',
sysPrefix: '/Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2',
envType: 'Venv',
envName: '.venv2',
envPath: [p],
architecture: 3,
sysVersion: '3.10.6 (v3.10.6:9c7b4bd164, Aug  1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)]',
version: [Object],
displayName: "Python 3.10.6 ('.venv2': venv)",
detailedDisplayName: "Python 3.10.6 ('.venv2': venv)",
uri: [p]
},
id: '.jvsc74a57bd073b427e724cc124a6e83459597e858deb3a8732b6302a65cc8c3c54873670842./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python./Users/theoleschevin/Library/CloudStorage/OneDrive-Personnel/Articles et Projet/EnnemisInterieur/BD/.venv2/python.-m#ipykernel_launcher'
}
}

我遇到这个错误,因为我使用的是系统代理。当我关闭它时,jupyter运行良好
所以我认为问题出在你的笔记本电脑网络上,而不是你的软件包上。

最新更新