gpt4 book ai didi

python - 没有这样的文件或目录: requirements. txt

转载 作者:太空宇宙 更新时间:2023-11-03 20:21:34 24 4
gpt4 key购买 nike

当前正在尝试运行脚本,但我遇到了缺少的requirements.txt问题。

这是 .sh 文件

#!/bin/bash -e
# Copyright 2019 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if [ -z "$1" ]
then
echo "Usage: ./deployCapability.sh <ACTION NAME>"
exit 1
fi

docker run --rm -v "$PWD:/tmp" ibmfunctions/action-python-v3.7 bash -c "cd /tmp && virtualenv virtualenv && source virtualenv/bin/activate && pip install -r /boxai/requirements.txt"
zip -r $1.zip virtualenv __main__.py ./src/action.py ./src/storage.py config.json ./src/bsk_utils.py ./src/__init__.py
ibmcloud fn action update $1 --kind python:3.7 $1.zip --web true --timeout 600000
date

rm $1.zip

当我运行 .sh 时,我会安装 setuptools、pip、wheel...完毕。然后它会吐出一个错误。

Error: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

我在哪里做错了什么?

更新:我的文件夹的位置在桌面上。我还更改了/boxai/requirements.txt 和/c/users/admin/desktop/boxai/requirements.txt 的路径......不走运。

谢谢

最佳答案

很难知道哪些文件在哪里,但您已经使用-v "$PWD:/tmp"<将一些文件安装到/tmp,但丢失的文件似乎是 /boxai/requirements.txt,它位于 /tmp

之外

所以,也许你需要添加 -v "$PWD/requirements.txt:/boxai/requirements.txt",它假设你运行的当前目录中有一个requirements.txt shell 脚本。

I also changed the path to /boxai/requirements.txt

如果您从某处下载了此脚本,我会将其更改回之前的状态,然后根据预期文件在容器中的位置将本地目录重新映射到容器中,而不是基于您的路径主持人。

关于python - 没有这样的文件或目录: requirements. txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58126460/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com