如何更高效地下载WHL文件?

huangapple go评论92阅读模式
英文:

How do I download WHL files more efficiently?

问题

我正在尝试在AWS Lambda上通过Lambda层使用pandasai库,但由于我的本地计算机正在使用Windows,因此我正在从PyPI下载该库的Linux WHL文件以用作Lambda层。然而,由于pandasai要求我以相同的方式安装许多共依赖项(例如matplotlib、pandas等),这将需要很长时间。

是否有更快/更好的方法可以做到这一点?是否有更有效的方法来安装Linux架构的Python库?(例如使用Docker映像/虚拟机)

谢谢。

英文:

I'm trying to use the pandasai library on AWS Lambda via Lambda layers, but since my local machine is using Windows, I'm downloading the Linux WHL file of the library from PyPI to put as a Lambda layer. However, since pandasai requires me to install a lot of co-dependencies in the same way (matplotlib, pandas, etc.), it will take a really long time.

Is there a quicker/better way to do this? Are there more efficient ways to install Linux architecture python libraries? (Like using Docker images/VMs)

Thanks.

答案1

得分: 0

你可以在可写目录中使用以下命令作为更快/更好的方式:

mkdir python
cd python
pip install --platform manylinux2014_x86_64 --target=.\ --implementation cp --python-version 3.8 --only-binary=:all: --upgrade pandasai
  1. 创建一个文件夹
  2. 切换到创建的文件夹
  3. 使用pip安装包,指定以下属性
  4. 最后压缩python文件夹,然后继续创建lambda层。
  • —-platform:指定要安装包的平台。
  • —-target:设置包的安装目标目录。
  • —-implementation:指定安装过程中要使用的Python实现。
  • —-python-version:指定要安装包的Python版本。
  • —-only-binary:告诉pip只考虑二进制包进行安装。
  • —-upgrade:告诉pip如果已经安装了包,则升级它。如果存在先前版本的包,它将被更新到最新可用版本。
英文:

You can use the below command in a writable directory as quicker/better way:

mkdir python
cd python
pip install --platform manylinux2014_x86_64 --target=.\ --implementation cp --python-version 3.8 --only-binary=:all: --upgrade pandasai
  1. Creates a folder
  2. Move to the created folder
  3. Install the package with pip specifying the below attributes
  4. Finally zip the python folder and proceed to create the lambda
    layer.
  • —-platform: Specifies the platform on which the package should be installed.
  • —-target: Sets the installation target directory for the package.
  • —-implementation: Specifies the Python implementation to use during installation
  • —-python-version: Specifies the Python version for which the package should be installed.
  • —-only-binary: Instructs pip to only consider binary packages during installation.
  • —-upgrade: Tells pip to upgrade the package if it's already installed. If a previous version of the package exists, it will be updated to the latest version available.

huangapple
  • 本文由 发表于 2023年6月13日 11:41:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76461561.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定