admin管理员组文章数量:1435823
After installing FastAPI as documented, the command fastapi dev fastapi_app/
fails with
| +-------------------------------- locals ---------------------------------+ | | | final = False | | | | input = '\U0001f4c1 gpt-oe-rfq-automation'
| | | | self = <encodings.cp1252.IncrementalEncoder object at
| | | | 0x0000024661D35D50>
| | | +-------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------+ UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4c1' in position 0: character maps to<undefined>
on git bash in Windows for Python 3.11 and 3.12.
How can this be fixed ?
After installing FastAPI as documented, the command fastapi dev fastapi_app/
fails with
| +-------------------------------- locals ---------------------------------+ | | | final = False | | | | input = '\U0001f4c1 gpt-oe-rfq-automation'
| | | | self = <encodings.cp1252.IncrementalEncoder object at
| | | | 0x0000024661D35D50>
| | | +-------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------+ UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4c1' in position 0: character maps to<undefined>
on git bash in Windows for Python 3.11 and 3.12.
How can this be fixed ?
Share Improve this question asked Nov 18, 2024 at 12:22 serv-incserv-inc 38.4k9 gold badges191 silver badges212 bronze badges1 Answer
Reset to default 0As documented in https://stackoverflow/a/63573649/1587329, this can be fixed by setting
export PYTHONIOENCODING=utf-8
in the shell. Afterwards, the message changes to [...]
┌─ Python package file structure ─┐ │
│ │本文标签: windowsfastapi dev fails with UnicodeEncodeErrorStack Overflow
版权声明:本文标题:windows - fastapi dev fails with UnicodeEncodeError - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745618690a2666554.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论