解决docker FileNotFoundError: [Errno 2] No such file or directory: ‘./data/train

简介: 解决docker FileNotFoundError: [Errno 2] No such file or directory: ‘./data/train

问题描述

使用docker运行python项目时出现路径不存在

FileNotFoundError: [Errno 2] No such file or directory: './data/train

解决方案:

将代码中的路径修改为绝对路径,例如我的项目工作目录为code,而工程代码在src中,在所有出现路径的位置变成 /code/src/data/train 即可。


目录
相关文章
|
13天前
|
关系型数据库 MySQL 数据库
docker MySQL删除数据库时的错误(errno: 39)
docker MySQL删除数据库时的错误(errno: 39)
68 0
|
7月前
|
关系型数据库 MySQL 数据库
Docker容器数据持久化之Data Volume(数据卷)与容器数据共享(1)
Docker容器数据持久化之Data Volume(数据卷)与容器数据共享(1)
101 0
|
8月前
|
Docker 容器
Docker错误:inotify_add_watch(7, /dev/dm-4, 10) failed: No such file or directory
Docker错误:inotify_add_watch(7, /dev/dm-4, 10) failed: No such file or directory
155 1
|
Docker 容器
Docker - MAC 电脑运行 docker-compose up -d 报 File "docker/transport/unixconn.py", line 43, in connect FileNotFoundError: [Errno 2] No such file or directory
Docker - MAC 电脑运行 docker-compose up -d 报 File "docker/transport/unixconn.py", line 43, in connect FileNotFoundError: [Errno 2] No such file or directory
540 0
Docker - MAC 电脑运行 docker-compose up -d 报 File "docker/transport/unixconn.py", line 43, in connect FileNotFoundError: [Errno 2] No such file or directory
|
13天前
|
应用服务中间件 Linux 开发工具
Docker File
Docker File
|
关系型数据库 MySQL Docker
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
1250 0
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
|
13天前
|
Ubuntu Shell 应用服务中间件
docker file的介绍
docker file的介绍
64 0
|
11月前
|
Java Docker 容器
docker部署jar file
docker部署jar file
66 0
|
Docker 容器
docker启动jupyter报错:OSError: [Errno 99] Cannot assign requested address
docker启动jupyter报错:OSError: [Errno 99] Cannot assign requested address
388 0
|
Docker Python 容器
解决docker 2022-11-16 14:54:26 python: can‘t open file ‘/src/main.py‘: [Errno 2]
解决docker 2022-11-16 14:54:26 python: can‘t open file ‘/src/main.py‘: [Errno 2]
140 0