我的目标是将一个包安装到我机器上的特定目录,以便我可以将它打包以与 AWS Lambda 一起使用。
这是我尝试过的:pip install snowflake-connector-python -t .
pip install --system --target=C:\Users\path2folder --install-option=--install-scripts=C:\Users\path2folder --upgrade snowflake-connector-python
这两个选项都返回了以下错误消息:ERROR: Can not combine '--user' and '--target'
为了让 AWS Lambda 函数正常工作,我需要将我的依赖项安装在特定目录中以创建用于部署的 .zip 文件。我已经通过 Google 和 StackOverflow 进行了搜索,但还没有看到回答这个问题的线程。
更新:这在 Mac 上似乎不是问题。所描述的问题是在 Windows 10 上。
最佳答案
我们在运行 pip install --target ./py_pkg -r requirements.txt --upgrade
时遇到了同样的问题使用 Microsoft Store 版本的 Python 3.9。
添加 --no-user
到最后似乎解决了这个问题。也许你可以在你的命令中尝试一下,让我们知道这个解决方案是否有效?pip install --target ./py_pkg -r requirements.txt --upgrade --no-user
关于python - 画中画安装 : Cannot combine --user and --target,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63783587/