[英]How can I install requirements.txt from docker-compose?
From the tutorial you point to - the statement 从您指向的教程 - 声明
ADD requirements.txt /code/
copies requirements.txt
file from your current directory on the host into /code/
directory inside the container. ADD requirements.txt /code/
copies requirements.txt
文件从主机上的当前目录到容器内的/code/
目录。 When docker-compose run
command is executed, it first builds the container at which point it loads the 'requirements.txt' file into it. 当执行
docker-compose run
命令时,它首先构建容器,此时它将'requirements.txt'文件加载到其中。
So if you want to make changes to it, do it locally before you run compose. 因此,如果您想对其进行更改,请在运行撰写之前在本地执行此操作。 This will build and run your dockerized app with the new packages in your modified
requirements.txt
file. 这将使用修改后的
requirements.txt
文件中的新包构建并运行您的dockerized应用程序。
Go into your virtual environment. 进入你的虚拟环境。 Your file name is
requirements.txt
您的文件名是
requirements.txt
You need to type in the terminal 您需要输入终端
pip install -r requirements.txt
This should install all the packages listed in your requirements.txt 这应该安装您的requirements.txt中列出的所有包
In case when some of your modules failed to install you have to manually install them. 如果某些模块安装失败,您必须手动安装它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.