首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >vscode交互式窗口中的Python包交战和权限拒绝

vscode交互式窗口中的Python包交战和权限拒绝
EN

Stack Overflow用户
提问于 2022-11-23 15:15:38
回答 1查看 44关注 0票数 0

操作系统: Arch linux(termux proot) Python版本: 3.10.8

我的错误信息如下

代码语言:javascript
运行
复制
Visual Studio Code (1.73.1, undefined, desktop)
Jupyter Extension Version: 2022.9.1303220346.
Python Extension Version: 2022.18.2.
Workspace folder /home/jack/Documents/Medical-segmentation
info 15:00:11.430: ZMQ install verified.
User belongs to experiment group 'jupyterTestcf'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 15:00:12.217: LSP Notebooks experiment is disabled -- not in treatment group
info 15:00:13.731: Got empty env vars with python /bin/python in 1275ms
info 15:00:13.731: Got env vars ourselves faster /bin/python with env var count 59 in 1276ms
info 15:00:13.768: Process Execution: > /bin/python -m pip list
> /bin/python -m pip list
info 15:00:22.102: Starting interactive window for resource '/home/jack/Documents/Medical-segmentation/snakes/example2.py'
info 15:00:22.512: Preferred Remote kernel for Interactive-1.interactive is undefined
info 15:00:25.004: Process Execution: > /bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2022.9.1303220346/pythonFiles/normalizeSelection.py
> /bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2022.9.1303220346/pythonFiles/normalizeSelection.py
info 15:00:25.022: Starting Jupyter Session startUsingPythonInterpreter, .jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a./bin/python./bin/python.-m#ipykernel_launcher (Python Path: , EnvType: Global, EnvName: '', Version: 3.10.8) for 'Interactive-1.interactive' (disableUI=false)
info 15:00:25.024: Computing working directory for resource '/home/jack/Documents/Medical-segmentation/snakes/example2.py'
info 15:00:25.054: Got env vars ourselves faster /bin/python with env var count 59 in 2ms
info 15:00:25.108: Process Execution: > /bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> /bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
info 15:00:25.266: Got env vars ourselves faster /bin/python with env var count 59 in 14ms
info 15:00:25.266: Got env vars ourselves faster /bin/python with env var count 59 in 6ms
info 15:00:25.308: Process Execution: > /bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"a946baa0-e0d4-41d4-b72d-1eed7330e6f9" --shell=9002 --transport="tcp" --iopub=9004 --f=/home/jack/.local/share/jupyter/runtime/kernel-v2-32230pKMrdOglR18w.json
> /bin/python -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"a946baa0-e0d4-41d4-b72d-1eed7330e6f9" --shell=9002 --transport="tcp" --iopub=9004 --f=/home/jack/.local/share/jupyter/runtime/kernel-v2-32230pKMrdOglR18w.json
info 15:00:25.308: Process Execution: cwd: ~/Documents/Medical-segmentation/snakes
cwd: ~/Documents/Medical-segmentation/snakes
info 15:00:25.823: Registering dummy command feature
info 15:00:27.946: ipykernel version & path 6.18.0, /usr/lib/python3.10/site-packages/ipykernel/__init__.py for /bin/python
info 15:00:29.175: Got empty env vars with python /bin/python in 4123ms
info 15:00:29.176: Got empty env vars with python /bin/python in 3924ms
info 15:00:29.176: Got empty env vars with python /bin/python in 3916ms
warn 15:00:33.920: StdErr from Kernel Process /usr/lib/python3.10/site-packages/traitlets/traitlets.py:2412: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(

warn 15:00:33.921: StdErr from Kernel Process /usr/lib/python3.10/site-packages/traitlets/traitlets.py:2366: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'a946baa0-e0d4-41d4-b72d-1eed7330e6f9' instead of 'b"a946baa0-e0d4-41d4-b72d-1eed7330e6f9"'.
  warn(

warn 15:00:33.964: StdErr from Kernel Process Permission denied (src/ip_resolver.cpp:542)

error 15:00:33.979: Disposing kernel process due to an error o [Error]: The kernel died. Error: /usr/lib/python3.10/site-packages/traitlets/traitlets.py:2412: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
/usr/lib/python3.10/site-packages/traitlets/traitlets.py:2366: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'a946baa0-e0d4-41d4-b72d-1eed7330e6f9' instead of 'b"a946baa0-e0d4-41d4-b72d-1eed7330e6f9"'.
  warn(
Permission denied (src/ip_resolver.cpp:542)... View Jupyter [log](command:jupyter.viewOutput) for further details.
    at ChildProcess.<anonymous> (/home/jack/.vscode/extensions/ms-toolsai.jupyter-2022.9.1303220346/out/extension.node.js:2:2195101)
    at ChildProcess.emit (node:events:538:35)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  category: 'kerneldied',
  kernelConnectionMetadata: {
    kind: 'startUsingPythonInterpreter',
    kernelSpec: {
      specFile: '/home/jack/.vscode/extensions/ms-toolsai.jupyter-2022.9.1303220346/temp/jupyter/kernels/python3108jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a/kernel.json',
      interpreterPath: '/bin/python',
      isRegisteredByVSC: 'registeredByNewVersionOfExt',
      name: 'python3108jvsc74a57bd0e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a',
      argv: [Array],
      language: 'python',
      executable: 'python',
      display_name: 'Python 3.10.8 64-bit',
      metadata: [Object],
      env: {}
    },

我遇到了这个错误消息,但是我在另一个termux系统中没有任何问题。我删除所有python和软件包并重新安装。这对我没用。

11/24更新:这很奇怪,因为我使用pip list查看另一个系统。它与我目前使用的系统是相同的版本。

代码语言:javascript
运行
复制
Package                Version
---------------------- -----------
aiohttp                3.8.3
aiohttp-socks          0.7.1
aiorpcX                0.22.1
aiosignal              1.2.0
anyio                  3.6.2
appdirs                1.4.4
argon2-cffi            21.3.0
argon2-cffi-bindings   21.2.0
asttokens              2.1.0
async-generator        1.10
async-timeout          4.0.2
attrs                  22.1.0
autocommand            2.2.2
Babel                  2.11.0
backcall               0.2.0
beautifulsoup4         4.11.1
bitstring              3.1.9
black                  22.10.0
bleach                 5.0.1
build                  0.9.0
certifi                2022.9.24
cffi                   1.15.1
chardet                5.0.0
charset-normalizer     3.0.0
click                  8.1.3
codespell              0.0.0
comm                   0.1.0
commonmark             0.9.1
contourpy              1.0.6
cryptography           38.0.1
cycler                 0.11.0
Cython                 0.29.32
debugpy                1.6.3
decorator              5.1.1
defusedxml             0.7.1
deprecation            2.1.0
dnspython              2.2.1
docopt                 0.6.2
docutils               0.19
ecdsa                  0.18.0
Electrum               4.3.1
entrypoints            0.4
executing              1.2.0
fastjsonschema         2.16.2
flake8                 5.0.4
flake8-black           0.3.3
flake8-isort           5.0.0
fonttools              4.38.0
frozenlist             1.3.1
future                 0.18.2
greenlet               1.1.3.post0
idna                   3.4
imageio                2.22.4
imutils                0.5.4
inflect                6.0.2
installer              0.5.1
ipykernel              6.18.0
ipython                8.6.0
ipython-genutils       0.2.0
isort                  5.10.1
jaraco.context         4.1.2
jaraco.functools       3.5.2
jaraco.text            3.11.0
jedi                   0.18.1
Jinja2                 3.1.2
json5                  0.9.10
jsonrpclib-pelix       0.4.3.2
jsonschema             4.17.1
jupyter_client         7.4.7
jupyter_core           5.0.0
jupyter_packaging      0.12.3
jupyter-server         1.23.3
jupyterlab             3.5.0
jupyterlab-pygments    0.2.2
jupyterlab_server      2.16.3
kiwisolver             1.4.4
lxml                   4.9.1
mackup                 0.8.36
markdown-it-py         2.1.0
MarkupSafe             2.1.1
matplotlib             3.6.2
matplotlib-inline      0.1.6
mccabe                 0.7.0
mdurl                  0.1.2
mistune                2.0.4
more-itertools         9.0.0
msgpack                1.0.4
multidict              6.0.2
mypy-extensions        0.4.3
mysql-connector-python 8.0.31
nbclassic              0.4.8
nbclient               0.7.0
nbconvert              7.2.5
nbformat               5.7.0
nest-asyncio           1.5.6
networkx               2.8.8
nibabel                4.0.2
notebook               6.5.2
notebook_shim          0.2.2
numpy                  1.23.4
ordered-set            4.1.0
packaging              21.3
pandas                 1.5.1
pandocfilters          1.5.0
parso                  0.8.3
pathspec               0.10.1
pbkdf2                 1.3
pep517                 0.13.0
pexpect                4.8.0
pickleshare            0.7.5
pikaur                 1.13
Pillow                 9.3.0
pip                    22.3
platformdirs           2.5.2
pluggy                 1.0.0
ply                    3.11
portalocker            2.6.0
progressbar2           4.2.0
prometheus-client      0.15.0
prompt-toolkit         3.0.33
protobuf               4.21.7
psutil                 5.9.4
ptyprocess             0.7.0
pure-eval              0.2.2
pyaes                  1.6.1
pyalpm                 0.10.6
pycodestyle            2.9.1
pycparser              2.21
pycryptodomex          3.12.0
pydantic               1.10.2
pyflakes               2.5.0
Pygments               2.13.0
pynvim                 0.4.3
pyparsing              3.0.9
PyQt5                  5.15.7
PyQt5-sip              12.11.0
pyrsistent             0.19.2
PySocks                1.7.1
python-dateutil        2.8.2
python-dotenv          0.21.0
python-lsp-jsonrpc     1.0.0
python-lsp-server      1.5.0
python-socks           2.0.3
python-utils           3.4.5
pytz                   2022.5
pytz-deprecation-shim  0.1.0.post0
PyWavelets             1.4.1
pyzmq                  24.0.1
qrcode                 7.3.1
regex                  2022.10.31
requests               2.28.1
requests-unixsocket    0.3.0
ruamel.yaml            0.17.21
ruamel.yaml.clib       0.2.7
scikit-image           0.19.3
scipy                  1.9.3
Send2Trash             1.8.0
setuptools             63.2.0
Shapely                1.8.2
six                    1.16.0
sniffio                1.3.0
soupsieve              2.3.2.post1
SQLAlchemy             1.4.43
stack-data             0.6.1
TBB                    0.2
terminado              0.17.0
testpath               0.6.0
tifffile               2022.10.10
tinycss2               1.2.1
toml                   0.10.2
tomli                  2.0.1
tomlkit                0.11.6
tornado                6.2
traitlets              5.5.0
trove-classifiers      2022.10.19
typing_extensions      4.4.0
tzdata                 2022.6
tzlocal                4.2
uc-micro-py            1.0.1
ujson                  5.5.0
urllib3                1.26.12
validate-pyproject     0.10.1
wcwidth                0.2.5
webencodings           0.5.1
websocket-client       1.4.1
wheel                  0.37.1
yarl                   1.8.1
EN

回答 1

Stack Overflow用户

发布于 2022-11-24 01:27:22

  1. 打开vscode,重新安装Python和朱庇特笔记本扩展。
  2. 在终端中重新安装ipykernel包。

同时,本期还提出了其他解决方案。

添加:

我在traitlets==4.3.3中遇到了同样的问题。我使用pip install traitlets更新了它,它是版本为5.5.0来解决这个问题的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74549086

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档