如何在从 Windows10 上的 Docker 映像运行的 Jupyter Notebook 上安装包

BI *_*ude 2 python windows docker jupyter-notebook

我尝试在 Windows 10 上设置 pySpark。经过一些各种挑战后,我决定改用 Docker Image,而且效果很好。

世界您好脚本工作。但是,我无法在由 Docker 提供支持的 Jupyter 上安装任何软件包。请指教。

通常,我可以在 Anaconda 终端上使用以下代码:

问题

The following command must be run outside of the IPython shell:

    $ pip install fastavro
Run Code Online (Sandbox Code Playgroud)

我找不到如何安装 INSIDE docker。请指教。

资源:

  • Docker 镜像 - jupyter/pyspark-notebook
  • 操作系统 - Windows 10

Pra*_*iel 6

在 Jupyter 单元/IPython shell 中,您可以运行:

!pip install PACKAGENAME 
Run Code Online (Sandbox Code Playgroud)

安装软件包。注意“!” 字首。

更新

当有多个环境时,使用该环境中使用的系统执行器(Python)。

!pip install PACKAGENAME 
Run Code Online (Sandbox Code Playgroud)