簡體   English   中英

AWS Python lambda:pip install requirements.txt with --no-deps

[英]AWS Python lambda: pip install requirements.txt with --no-deps

使用 AWS CDK v2,我想部署兩個lambda 函數 由於兩者都依賴於pandas ,我想先部署一個,該層具有pandas及其在位於entryrequirements.txt中的依賴項。

lambda 函數之一也依賴於pyarrow ,我將其放入位於 lambda function entryrequirements.txt中。 As both pyarrow and pandas depend numpy , I currently end up with numpy and its dependencies being installed both in the layer and that lambda function, which obviously isn't what I want.

最后,我正在尋找一種將--no-deps傳遞給pip安裝的 lambda functionrequirements.txt的方法,這取決於。 任何想法如何實現這一目標?

我認為在使用 requirements.txt 時無法指定no-deps CDK 也可以使用pipenvPipfilePoetrypoetry.lock 話雖如此,在我的研究中,這些工具似乎都不支持使用--no-deps進行安裝,除非您手動弄亂了鎖定文件(實際上不建議或可維護)。

深入研究具體問題,我沒有看到pyarrowpandas列為依賴項,但我確實看到它安裝numpy這是pandas的依賴項

我認為你目前最好的選擇是只處理在兩個地方都有numpy或將pyarrowpandas放在層中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM