【问题标题】:Docker Ubuntu 20.04 - Cannot uninstall 'terminado' and problems with pipDocker Ubuntu 20.04 - 无法卸载“终端”和 pip 问题
【发布时间】:2020-08-29 09:28:10
【问题描述】:

我正在尝试在 Ubuntu 20.04 上重现本书 "Mining the Social Web" (Russel/Klassen) 的 Docker 安装。我设置了 Docker 并尝试直接从存储库创建 Docker 容器(repo2docker https://github.com/mikhailklassen/Mining-the-Social-Web-3rd-Edition)以打开 Jupyter Notebook,但出现错误。在我安装 Python3 和 pip3 之前(不能只安装 Python 和 pip)。

在运行代码中得到这个倍数:

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.

(无法修复内部链接的问题)

以及代码末尾的这个错误:

ERROR: Cannot uninstall 'terminado'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Removing intermediate container 71cfe8e913dd
The command '/bin/sh -c ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r "binder/requirements.txt"' returned a non-zero code:1

也许有人可以帮助我?非常感谢!

【问题讨论】:

  • 你在哪个命令上得到这个错误?
  • 运行docker并输入命令后:repo2docker github.com/mikhailklassen/Mining-the-Social-Web-3rd-Edition
  • 确保使用pip3 install jupyter-repo2docker安装它?
  • 无法卸载binder/requirements.tx中指定的tornado==6.0.2。首先尝试通过以下方式卸载:pip uninstall tornado 如果不起作用,请尝试从站点包中手动将其删除。如果不起作用,我的建议是创建一个 virtualenv 并在 virtualenv 中执行 Python 安装步骤,基本上是“POST Docker”步骤。
  • 感谢您的回答! @Turan Lalwani:pip3 install jupyter-repo2docker 似乎有效,但我在代码 WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. 中得到了相同的警告

标签: python-3.x docker pip ubuntu-20.04


【解决方案1】:

解决您的问题,不要使用 docker,因为由于 pip 安装说明,它将无法卸载纯 distutil 包的 tornado 包。使用以下解决方案:

我从事虚拟环境的工作,建议您也这样做。

克隆仓库

导航到 /binder

执行pip install --ignore-installed -r requirements.txt

导航到 /notebooks 执行jupyter notebook

【讨论】:

  • 为此:执行pip install --ignore-installed -r requirements.txt 我得到了:Defaulting to user installation because normal site-packages is not writeable ERROR: Could not open requirements file: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'requirements.txt'
  • 导航到 /notebooks 执行 jupyter notebook 我得到了:Traceback (most recent call last): File "/home/ubu20_admin/.local/bin/jupyter-notebook", line 5, in <module> from notebook.notebookapp import main File "/home/ubu20_admin/.local/lib/python3.8/site-packages/notebook/__init__.py", line 25, in <module> from .nbextensions import install_nbextension
  • File "/home/ubu20_admin/.local/lib/python3.8/site-packages/notebook/nbextensions.py", line 605, in <module> from .extensions import ( File "/home/ubu20_admin/.local/lib/python3.8/site-packages/notebook/extensions.py", line 8, in <module> from tornado.log import LogFormatter ModuleNotFoundError: No module named 'tornado'
  • 不知道我到底做了什么,但现在它可以工作了,我可以从终端打开 jupyter 笔记本(我想我刚刚用pip3 install tornado --user --ignore-installed安装了龙卷风
  • 很高兴知道:)
【解决方案2】:

来自答案:https://stackoverflow.com/a/67134670/1290868

对我来说是 requirements.txt 中的这一行;

...
jupyterlab>=1.0
....

删除了版本部分 (">=1.0") 并且它起作用了;

...
jupyterlab
....

【讨论】:

    【解决方案3】:

    我正在尝试更新 jupyter notebook / jupyterlab,但遇到了终端问题,不确定它是什么。即使在卸载它之后,它也是 avl(不知道为什么)。 因此,我卸载了 jupyterlab 并重新安装了它。

    【讨论】:

      猜你喜欢
      • 2020-09-25
      • 1970-01-01
      • 2021-02-21
      • 2020-09-10
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 2021-10-03
      相关资源
      最近更新 更多