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 ─┐ │
│ │发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745618691a4636389.html
评论列表(0条)