gpt4 book ai didi

python - qpython android IOError : [Erno 2] No such file or directory

转载 作者:行者123 更新时间:2023-12-02 10:42:35 27 4
gpt4 key购买 nike

我正在尝试从qpython中的简单python脚本调用图像,但收到错误消息:

qpython android IOError: [Erno 2] No such file or directory

我想知道我是否使用正确的目录约定?这是代码:
import numpy as np
from PIL import Image

spinner = {
1: Image.open('storage/emulated/0/qpython/scripts/shapes/norm.jpg','r'),
2: Image.open('storage/emulated/0/qpython/scripts/shapes/square.jpg','r'),
3: Image.open('storage/emulated/0/qpython/scripts/shapes/fly.jpg','r'),
4: Image.open('storage/emulated/0/qpython/scripts/shapes/tri.jpg','r'),
5: Image.open('storage/emulated/0/qpython/scripts/shapes/special.jpg','r'),
6: Image.open('storage/emulated/0/qpython/scripts/shapes/rect.jpg','r'),
7: Image.open('storage/emulated/0/qpython/scripts/shapes/salad.jpg','r'),
8: Image.open('storage/emulated/0/qpython/scripts/shapes/circle.jpg','r'),
9: Image.open('storage/emulated/0/qpython/scripts/shapes/banana.jpg','r')
}

没有'r'参数时,它将引发相同的错误。还尝试了双正向和反斜线...

最佳答案

似乎您尚未设置图像的完整路径,因此它会错过绝对路径开头的斜线。

尝试使用/storage/emulated .....而不是存储/模拟....

关于python - qpython android IOError : [Erno 2] No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46957757/

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