[英]Pip is not installing packages on docker
So i have a docker image created with django cookiecutter and i need to install additional python packages for my app to work. 所以我有一个用django cookiecutter创建的docker镜像,我需要安装其他python软件包才能使我的应用程序正常工作。 The package im trying to install is django markdown , so i edited the base.txt in the requirements folder, and when i run the command
sudo docker-compose -f dev.yml run django pip install -r requirements/base.txt
it shows me this output: 我要安装的软件包是django markdown ,所以我在需求文件夹中编辑了base.txt,当我运行命令
sudo docker-compose -f dev.yml run django pip install -r requirements/base.txt
它显示了我这个输出:
So it looks like it actually installed the package but if i run it again it looks like its the first time and tries to install it again, also if i try to run my django project i get ImportError: No module named 'django_markdown'
. 因此,看起来好像它实际上已经安装了该软件包,但是如果我再次运行它,它看起来像是它的第一次并尝试再次安装它,而且如果我尝试运行我的django项目,我也会得到
ImportError: No module named 'django_markdown'
。 What could be causing this issue and what is the workaround i should do?. 是什么可能导致此问题,我应该怎么办?
I've tried installing different packages even with the sudo docker-compose -f dev.yml run django pip install [package name]
command with the same results 我已经尝试安装不同的软件包,即使使用
sudo docker-compose -f dev.yml run django pip install [package name]
命令也具有相同的结果
当您尝试在Docker中安装新软件包时,需要重建映像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.