我正在尝试使用 Vercel 部署 Flask 应用程序,但在构建过程中遇到错误,内容如下:
[Error: ENOENT: no such file or directory, lstat '/vercel/path0/werkzeug/__pycache__/_compat.cpython-39.pyc'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/vercel/path0/werkzeug/__pycache__/_compat.cpython-39.pyc'
}
完整的控制台日志如下。
Running build in Washington, D.C., USA (East) – iad1
Cloning github.com/AjayaRamachandran/PowerScore (Branch: main, Commit: 383d0a9)
Cloning completed: 2.337s
Restored build cache
Running "vercel build"
Vercel CLI 34.3.0
Installing required dependencies...
Installing required dependencies...
Installing required dependencies...
Installing required dependencies...
Installing required dependencies...
Build Completed in /vercel/output [1m]
[Error: ENOENT: no such file or directory, lstat '/vercel/path0/werkzeug/__pycache__/_compat.cpython-39.pyc'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/vercel/path0/werkzeug/__pycache__/_compat.cpython-39.pyc'
}
我的文件结构如下所示:
root
- api
- static
- app.py
- templates
- index.html
- ...
- requirements.txt
- vercel.json
- ...
- Pipfile
- Pipfile.lock
旁注:
pipfile
和pipfile.lock
位于api
文件夹之外,因为当它们位于构建器内部时,构建器会跳过很多安装,尽管构建将完成,但最终域上只会有error 404
。从 api
文件夹中删除这些内容后,似乎不会跳过任何安装,但它会导致困扰我的 Werkzeug
冲突。任何帮助,将不胜感激。谢谢!
这个问题已经解决了。我的文件结构不正确。