简体   繁体   English

docker container jupyter lab,如何添加其他包?

[英]docker container jupyter lab, how to add other packages?

I'm using docker for deep learning.我正在使用 docker 进行深度学习。 and i'm super beginner as docker user.我是 docker 用户的超级初学者。 ubuntu 18.04 docker version 19.03.6 and i got ufoym/deepo image. ubuntu 18.04 docker 19.03.6 版,我得到了 ufoym/deepo 图像。 so i'm using jupyter lab in web.所以我在网络中使用 jupyter 实验室。 container 1 : jupyter lab container 2 : vscode容器 1:jupyter 实验室容器 2:vscode

question 1. if i want to use other python packages(like matplotlib basemap toolkits, hdbscan,folium that doesn't contain in ufoym/deepo image) , how can i install and build those packages?问题 1. 如果我想使用其他 python 包(如 ufoym/deepo 图像中不包含的 matplotlib 底图工具包、hdbscan、folium),我该如何安装和构建这些包? 2. in jupyter lab, when i do (eg) !pip install foium, then where is the installed directory ?? 2. 在 jupyter 实验室中,当我执行(例如)!pip install foium 时,安装目录在哪里?? and is it the right way to use (pip install?) in docker system?这是在docker系统中使用(pip install?)的正确方法吗?

please help me~请帮帮我~

Yes, you absolutely can use pip inside the docker container.是的,您绝对可以在 docker 容器内使用pip The official Python Docker image actually already comes with pip preinstalled.官方的 Python Docker 镜像实际上已经预装了pip

The usual way pip is used in the container is by placing a requirements.txt in your project folder, the one that will then be mapped inside the container.在容器中使用pip的通常方式是在您的项目文件夹中放置一个requirements.txt ,然后该文件夹将被映射到容器中。 In your Dockefile you should then add these lines to install the packages.在您的Dockefile您应该添加这些行来安装软件包。

COPY requirements.txt <path to the folder your app will live inside the container>
RUN pip install -r requirements.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM