python manage.py runserver报错UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd5 in position 0

在学习Python Django入门时,遇到`python manage.py runserver`命令执行时的UnicodeDecodeError。错误源于'utf-8'编码无法解码字节0xd5。问题定位在socket.py文件,由于主机名设置为非英文导致。将主机名改为英文'Zhao'后,问题成功解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

正在学习ython编程 从入门到实践 第18章Django入门,使用Win10的cmd。

创建了虚拟环境后运行python manage.py runserver报错UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 0: invalid continuation byte

(ll_env) C:\Users\Administrator\Desktop\pythonwork\mywork\s18\learning_log>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
May 03, 2021 - 21:49:48
Django version 3.2, using settings 'learning_log.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "D:\python35\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "D:\python35\lib\threading.py", line 870, in run
    self._target(
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

超棒史迪仔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值