如何在Elastic Beanstalk上卸载pip软件包 [英] How to uninstall pip packages on Elastic Beanstalk

查看:90
本文介绍了如何在Elastic Beanstalk上卸载pip软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Elastic Beanstalk上卸载pip软件包?

How to uninstall pip packages on Elastic Beanstalk?

我们在requirements.txt文件中删除了一个程序包,但我们认为该程序包仍然存在,因为它导致与我们使用相同名称创建的另一个应用程序发生命名空间冲突.

We removed a package in our requirements.txt file, but we think the package is still there because its causing a namespace collision with another app we created with the exact same name.

详细信息:

我们曾经把这个软件包设为django-whatever.在我们的.py文件中,它的导入方式类似于

We used to have this package django-whatever. In our .py files, it was imported like

from whatever import something

该程序包没有给予我们足够的控制权,因此我们推出了自己的程序包

the package wasn't giving us enough control, so we rolled out our own package called whatever

我们像这样使用

from whatever import goodstuff

AWS EB现在返回错误无法从任何东西进口货物",这严重暗示着django-无论安装了什么,甚至没有安装在requirements.txt中.

AWS EB now returns an error "cannot import goodstuff from whatever" which heavily implies that django-whatever is still installed even tho its not in requirements.txt

推荐答案

到目前为止,我认为最好的选择是ssh进入实例并执行以下操作:

So far, I think the best option is to ssh into the instance and do something like:

source /opt/python/run/venv/bin/activate && yes | pip uninstall package-to-uninstall

您也可以在.ebextensions的syspackages.config文件中将以下内容添加为container_command:

You can alternatively add the following as a container_command in your syspackages.config file in .ebextensions :

command: "source /opt/python/run/venv/bin/activate && yes | pip uninstall package-to-uninstall"

请,如果您想出一种更优雅的方法来解决此问题,请告诉我.

Please, let me know if you figured out a more elegant way to fix this.

这篇关于如何在Elastic Beanstalk上卸载pip软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆