jupyter contrib nbextension 安装给出 Jupyter 命令 `jupyter-contrib` 未找到

发布于 2025-01-09 23:28:31 字数 6444 浏览 0 评论 0原文

尝试通过终端中的以下步骤(重新)安装 Jupyter 的 nbextension

  1. pip install jupyter_contrib_nbextensions
  2. jupyter contrib nbextension install --user
  3. install --user jupyter nbextension enable varInspector/main

步骤 1 = 运行并且我能够通过“jupyter Notebook”启动笔记本在终端就好了。

步骤 2 = 失败,

usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
               [--paths] [--json] [--debug]
               [subcommand]

Jupyter: Interactive Computing

positional arguments:
  subcommand     the subcommand to launch

optional arguments:
  -h, --help     show this help message and exit
  --version      show the versions of core jupyter packages and exit
  --config-dir   show Jupyter config dir
  --data-dir     show Jupyter data dir
  --runtime-dir  show Jupyter runtime dir
  --paths        show all Jupyter paths. Add --json for machine-readable
                 format.
  --json         output paths as machine-readable json
  --debug        output debug information about paths

Available subcommands: bundlerextension console execute kernel kernelspec
migrate nbconvert nbextension notebook qtconsole run serverextension
troubleshoot trust

Jupyter command `jupyter-contrib` not found.

Python 版本 = Python 3.10.2

我的包列表

Package                           Version
--------------------------------- ---------
argon2-cffi                       21.3.0
argon2-cffi-bindings              21.2.0
asteval                           0.9.26
asttokens                         2.0.5
attrs                             21.4.0
backcall                          0.2.0
black                             22.1.0
bleach                            4.1.0
cachetools                        5.0.0
certifi                           2021.10.8
cffi                              1.15.0
charset-normalizer                2.0.12
click                             8.0.4
colorama                          0.4.4
cycler                            0.11.0
db-dtypes                         0.3.1
debugpy                           1.5.1
decorator                         5.1.1
defusedxml                        0.7.1
entrypoints                       0.4
executing                         0.8.2
fonttools                         4.29.1
future                            0.18.2
google-api-core                   2.5.0
google-auth                       2.6.0
google-auth-oauthlib              0.5.0
google-cloud-bigquery             2.34.0
google-cloud-bigquery-storage     2.12.0
google-cloud-core                 2.2.2
google-crc32c                     1.3.0
google-resumable-media            2.3.0
googleapis-common-protos          1.55.0
grpcio                            1.44.0
grpcio-status                     1.44.0
idna                              3.3
ipykernel                         6.9.1
ipython                           8.0.1
ipython-genutils                  0.2.0
ipywidgets                        7.6.5
jedi                              0.18.1
Jinja2                            3.0.3
joblib                            1.1.0
jsonschema                        4.4.0
jupyter-client                    7.1.2
jupyter-console                   6.4.0
jupyter-contrib-core              0.3.3
jupyter-contrib-nbextensions      0.5.1
jupyter-core                      4.9.2
jupyter-highlight-selected-word   0.2.0
jupyter-latex-envs                1.4.6
jupyter-nbextensions-configurator 0.4.1
jupyterlab-pygments               0.1.2
jupyterlab-widgets                1.0.2
kiwisolver                        1.3.2
lmfit                             1.0.3
lxml                              4.8.0
MarkupSafe                        2.1.0
matplotlib                        3.5.1
matplotlib-inline                 0.1.3
mistune                           0.8.4
mpmath                            1.2.1
mypy-extensions                   0.4.3
nbclient                          0.5.11
nbconvert                         5.6.1
nbformat                          5.1.3
nest-asyncio                      1.5.4
notebook                          5.7.10
numpy                             1.22.2
oauthlib                          3.2.0
packaging                         21.3
pandas                            1.4.1
pandas-gbq                        0.17.1
pandocfilters                     1.5.0
parso                             0.8.3
pathspec                          0.9.0
patsy                             0.5.2
pickleshare                       0.7.5
Pillow                            9.0.1
pip                               22.0.3
platformdirs                      2.5.1
prometheus-client                 0.13.1
prompt-toolkit                    3.0.28
proto-plus                        1.20.3
protobuf                          3.19.4
pure-eval                         0.2.2
pyarrow                           6.0.1
pyasn1                            0.4.8
pyasn1-modules                    0.2.8
pycparser                         2.21
pydata-google-auth                1.3.0
Pygments                          2.11.2
pyparsing                         3.0.7
pyrsistent                        0.18.1
python-dateutil                   2.8.2
pytz                              2021.3
pywin32                           303
pywinpty                          2.0.2
PyYAML                            6.0
pyzmq                             22.3.0
qtconsole                         5.2.2
QtPy                              2.0.1
requests                          2.27.1
requests-oauthlib                 1.3.1
rsa                               4.8
scikit-learn                      1.0.2
scipy                             1.8.0
seaborn                           0.11.2
Send2Trash                        1.8.0
setuptools                        58.1.0
six                               1.16.0
sklearn                           0.0
stack-data                        0.2.0
statsmodels                       0.13.2
sympy                             1.9
terminado                         0.13.1
testpath                          0.6.0
threadpoolctl                     3.1.0
tomli                             2.0.1
tornado                           6.1
traitlets                         5.1.1
uncertainties                     3.1.6
urllib3                           1.26.8
wcwidth                           0.2.5
webencodings                      0.5.1
widgetsnbextension                3.5.2

Trying to (re)install Jupyter's nbextension via the following steps in terminal

  1. pip install jupyter_contrib_nbextensions
  2. jupyter contrib nbextension install --user
  3. install --user jupyter nbextension enable varInspector/main

Step 1 = runs and i am able to launch notebooks via "jupyter notebook" in terminal just fine.

Step 2 = fails with

usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
               [--paths] [--json] [--debug]
               [subcommand]

Jupyter: Interactive Computing

positional arguments:
  subcommand     the subcommand to launch

optional arguments:
  -h, --help     show this help message and exit
  --version      show the versions of core jupyter packages and exit
  --config-dir   show Jupyter config dir
  --data-dir     show Jupyter data dir
  --runtime-dir  show Jupyter runtime dir
  --paths        show all Jupyter paths. Add --json for machine-readable
                 format.
  --json         output paths as machine-readable json
  --debug        output debug information about paths

Available subcommands: bundlerextension console execute kernel kernelspec
migrate nbconvert nbextension notebook qtconsole run serverextension
troubleshoot trust

Jupyter command `jupyter-contrib` not found.

python version = Python 3.10.2

my list of packages

Package                           Version
--------------------------------- ---------
argon2-cffi                       21.3.0
argon2-cffi-bindings              21.2.0
asteval                           0.9.26
asttokens                         2.0.5
attrs                             21.4.0
backcall                          0.2.0
black                             22.1.0
bleach                            4.1.0
cachetools                        5.0.0
certifi                           2021.10.8
cffi                              1.15.0
charset-normalizer                2.0.12
click                             8.0.4
colorama                          0.4.4
cycler                            0.11.0
db-dtypes                         0.3.1
debugpy                           1.5.1
decorator                         5.1.1
defusedxml                        0.7.1
entrypoints                       0.4
executing                         0.8.2
fonttools                         4.29.1
future                            0.18.2
google-api-core                   2.5.0
google-auth                       2.6.0
google-auth-oauthlib              0.5.0
google-cloud-bigquery             2.34.0
google-cloud-bigquery-storage     2.12.0
google-cloud-core                 2.2.2
google-crc32c                     1.3.0
google-resumable-media            2.3.0
googleapis-common-protos          1.55.0
grpcio                            1.44.0
grpcio-status                     1.44.0
idna                              3.3
ipykernel                         6.9.1
ipython                           8.0.1
ipython-genutils                  0.2.0
ipywidgets                        7.6.5
jedi                              0.18.1
Jinja2                            3.0.3
joblib                            1.1.0
jsonschema                        4.4.0
jupyter-client                    7.1.2
jupyter-console                   6.4.0
jupyter-contrib-core              0.3.3
jupyter-contrib-nbextensions      0.5.1
jupyter-core                      4.9.2
jupyter-highlight-selected-word   0.2.0
jupyter-latex-envs                1.4.6
jupyter-nbextensions-configurator 0.4.1
jupyterlab-pygments               0.1.2
jupyterlab-widgets                1.0.2
kiwisolver                        1.3.2
lmfit                             1.0.3
lxml                              4.8.0
MarkupSafe                        2.1.0
matplotlib                        3.5.1
matplotlib-inline                 0.1.3
mistune                           0.8.4
mpmath                            1.2.1
mypy-extensions                   0.4.3
nbclient                          0.5.11
nbconvert                         5.6.1
nbformat                          5.1.3
nest-asyncio                      1.5.4
notebook                          5.7.10
numpy                             1.22.2
oauthlib                          3.2.0
packaging                         21.3
pandas                            1.4.1
pandas-gbq                        0.17.1
pandocfilters                     1.5.0
parso                             0.8.3
pathspec                          0.9.0
patsy                             0.5.2
pickleshare                       0.7.5
Pillow                            9.0.1
pip                               22.0.3
platformdirs                      2.5.1
prometheus-client                 0.13.1
prompt-toolkit                    3.0.28
proto-plus                        1.20.3
protobuf                          3.19.4
pure-eval                         0.2.2
pyarrow                           6.0.1
pyasn1                            0.4.8
pyasn1-modules                    0.2.8
pycparser                         2.21
pydata-google-auth                1.3.0
Pygments                          2.11.2
pyparsing                         3.0.7
pyrsistent                        0.18.1
python-dateutil                   2.8.2
pytz                              2021.3
pywin32                           303
pywinpty                          2.0.2
PyYAML                            6.0
pyzmq                             22.3.0
qtconsole                         5.2.2
QtPy                              2.0.1
requests                          2.27.1
requests-oauthlib                 1.3.1
rsa                               4.8
scikit-learn                      1.0.2
scipy                             1.8.0
seaborn                           0.11.2
Send2Trash                        1.8.0
setuptools                        58.1.0
six                               1.16.0
sklearn                           0.0
stack-data                        0.2.0
statsmodels                       0.13.2
sympy                             1.9
terminado                         0.13.1
testpath                          0.6.0
threadpoolctl                     3.1.0
tomli                             2.0.1
tornado                           6.1
traitlets                         5.1.1
uncertainties                     3.1.6
urllib3                           1.26.8
wcwidth                           0.2.5
webencodings                      0.5.1
widgetsnbextension                3.5.2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

痴情换悲伤 2025-01-16 23:28:32

因此,如果有人因任何原因遇到与我类似的情况,可能是因为购买了一台新机器,IT 人员施展巫毒魔法,将我的旧东西转移到这台新机器上。

不管怎样,在我拿到新机器后,我仍然需要安装很多东西,我无法准确指出是什么导致了我的问题,但最终我能够解决。请跟随我到下面...


检查我的(正在搜索)python.exe 文件,我发现(搜索返回)有 2 个 python.exe 存在的路径。第一个被添加为环境变量(添加到 Windows 路径)

  1. C:\Users-----\AppData\Local\Programs\Python\Python310
  2. C:\Users----\AppData\Roaming\Python\Python310\

第二个没加。将漫游版本添加到路径变量并没有解决问题,而是给出了额外的错误:
启动器中的致命错误:无法使用“C:\Program Files\Python310\python.exe”创建进程


所以

  1. 我卸载了python(之前完成的操作并没有帮助单独完成此操作)< /p>

  2. 删除了指向 python 的所有环境变量(这里是环境变量以防万一 - https://www.computerhope.com/issues/ch000549.htm)

  3. 从 VS 代码中卸载了 python 扩展
    (https://marketplace.visualstudio.com/items?itemName=ms-python .python)

  4. 删除上面两个路径中提到的Python文件夹

  5. 然后重新安装python(安装时点击了add to path)

  6. 重新安装了VS code python扩展

  7. 现在一切正常。

祝你好运

So in case anyone comes across similar for any reason with me encountering this probably due getting a new machine and IT doing their voodoo magic transferring my old stuff to this new machine.

Anyhow, there were a bunch of things I still needed to install after I got my new machine and i am not able to exactly pin point what caused issues from my question but in the end I was able to resolve. Follow me there below ...


Checking out my (doing search) python.exe file I found (search returned) 2 paths where python.exe was present. First one was added as an environment variable (added to windows path)

  1. C:\Users-----\AppData\Local\Programs\Python\Python310
  2. C:\Users----\AppData\Roaming\Python\Python310\

Second one not added. Adding roaming version to path variables did not solve the issue and gave additional errors instead:
Fatal error in launcher: Unable to create process using '"C:\Program Files\Python310\python.exe"


So

  1. I uninstalled python (done that before didnt help doing just that alone)

  2. Deleted all environment variables pointing to python (here is what environment variables are just in case - https://www.computerhope.com/issues/ch000549.htm)

  3. Uninstalled python extension from VS code
    (https://marketplace.visualstudio.com/items?itemName=ms-python.python)

  4. Deleted Python folders mentioned in the two paths above

  5. Then reinstalled python (clicked add to path during installation)

  6. Reinstalled VS code python extension

  7. Everything works now.

Best of luck

半衬遮猫 2025-01-16 23:28:32

即使在 ec2 实例上安装 jupyter 笔记本,您也会遇到此问题,因此您可以简单地解决此问题。

您必须通过以下命令升级 pip 并安装笔记本。

在终端中运行此命令

pip3 install --upgrade pip

pip3 install notebook

You will face this issue even while installing jupyter notebook on an ec2 instance so you can solve this issue simply by.

You have to upgrade pip and install notebook by the below command.

run this commands in terminal

pip3 install --upgrade pip

pip3 install notebook
橙味迷妹 2025-01-16 23:28:32

对我来说,这是 PATH 的问题。
在窗口中的命令行中,我收到错误,我运行

> set PATH=%PATH%;C:\Users\USER1\AppData\Roaming\Python\Python36\Scripts

并且一切正常。

For me, it was a problem with the PATH.
At the command line in the window I was getting the error, I ran

> set PATH=%PATH%;C:\Users\USER1\AppData\Roaming\Python\Python36\Scripts

and everything worked.

红墙和绿瓦 2025-01-16 23:28:32

更新:2024 年 6 月

该解决方案对我有用:

conda install -c conda-forge notebook
conda install -c conda-forge jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

然后,jupyter contrib nbextension install --user 执行时没有错误。

现在您可以像这样启用 jupyter 扩展(例如黑色):

jupyter nbextensions_configurator enable --user

并且,

jupyter nbextension enable jupyter-black-master/jupyter-black

Update: June, 2024

The solution worked for me:

conda install -c conda-forge notebook
conda install -c conda-forge jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

Then, jupyter contrib nbextension install --user executes without error.

Now you can enable jupyter extensions (e.g. black) like this:

jupyter nbextensions_configurator enable --user

and,

jupyter nbextension enable jupyter-black-master/jupyter-black
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文