在MockingBird根目录下有这个路径跟文件,但运行python3 web.py后打开网页时候显示找不到该文件
FileNotFoundError: [Errno 2] No such file or directory: '.\mkgui\static\mb.png'
Traceback:
File "/usr/local/lib/python3.8/dist-packages/streamlit/scriptrunner/script_runner.py", line 443, in _run_script
exec(code, module.dict)
File "/tmp/tmpi1hir5nj.py", line 14, in
render_streamlit_ui()
File "/root/MockingBird/mkgui/base/ui/streamlit_ui.py", line 848, in render_streamlit_ui
image = Image.open('.\mkgui\static\mb.png')
File "/usr/local/lib/python3.8/dist-packages/PIL/Image.py", line 3092, in open
fp = builtins.open(filename, "rb")
2条答案
按热度按时间yr9zkbsy1#
你是在根目录运行的嘛?看下 '.\mkgui\static\mb.png' 文件在吗
tquggr8v2#
'.\mkgui\static\mb.png' 改为'./mkgui/static/mb.png'就好了,linux下的文件系统兼容性问题