windows - fastapi dev fails with UnicodeEncodeError - Stack Overflow

After installing FastAPI as documented, the command fastapi dev fastapi_app fails with| +-------------

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

As 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

相关推荐

  • windows - fastapi dev fails with UnicodeEncodeError - Stack Overflow

    After installing FastAPI as documented, the command fastapi dev fastapi_app fails with| +-------------

    5小时前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信