Comments (13)
给后来人总结一下:
WIN10 的时区设置可能因为迷之原因无效,这时需要去重新设置一下。
根据遇到这个问题的群友描述,他是在使用了 V2Ray 之后,时区设置就会无效,每次启动 V2Ray 之后都得重新修改时区设置。
设置方法:
-
依次点开
控制面板 -> 时钟和区域 -> 更改时区
,可以看到“无法识别你当前的时区……” -
直接更改时区即可
from nonebot2.
https://github.com/regebro/tzlocal/blob/2.1/tzlocal/win32.py#L84
看了一下你的报错,看起来跟这个 2.1 版本的 get_localzone_name
的实现有关,是上游问题。
相关issue:
regebro/tzlocal#103
建议重设一下本机时区,估计就好了
from nonebot2.
提供一下环境中 pytz
和 tzlocal
的版本(执行 pip list
)。
pytz 2020.1
pytzdata 2020.1
tzlocal 2.1
测试没有报错
from nonebot2.
pip list|findstr "pytz"
pytz 2020.4
pip list|findstr "tzlocal"
tzlocal 2.1
pytzdata 无(没有这个包)
from nonebot2.
安装一下 pytzdata
试试呢
pytz 2020.4 测试通过
from nonebot2.
一样的错误
from nonebot2.
首先确认你的 python 环境。
接下来在正确的 python 环境中:
贴一下 pip list
结果中的 pytz
pytzdata
tzlocal
apscheduler
的版本
和在 python shell 中执行下面这段代码的结果的截图:
>>> from tzlocal import get_localzone
>>> get_localzone()
>>> from apscheduler.schedulers.asyncio import AsyncIOScheduler
>>> AsyncIOScheduler()
from nonebot2.
>>> from tzlocal import get_localzone
>>> get_localzone()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\Anaconda3\lib\site-packages\tzlocal\win32.py", line 93, in get_localzone
_cache_tz = pytz.timezone(get_localzone_name())
File "E:\Anaconda3\lib\site-packages\tzlocal\win32.py", line 84, in get_localzone_name
raise pytz.UnknownTimeZoneError('Can not find timezone ' + tzkeyname)
pytz.exceptions.UnknownTimeZoneError: 'Can not find timezone '
>>> from apscheduler.schedulers.asyncio import AsyncIOScheduler
>>> AsyncIOScheduler()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\Anaconda3\lib\site-packages\apscheduler\schedulers\base.py", line 87, in __init__
self.configure(gconfig, **options)
File "E:\Anaconda3\lib\site-packages\apscheduler\schedulers\base.py", line 126, in configure
self._configure(config)
File "E:\Anaconda3\lib\site-packages\apscheduler\schedulers\asyncio.py", line 48, in _configure
super(AsyncIOScheduler, self)._configure(config)
File "E:\Anaconda3\lib\site-packages\apscheduler\schedulers\base.py", line 697, in _configure
self.timezone = astimezone(config.pop('timezone', None)) or get_localzone()
File "E:\Anaconda3\lib\site-packages\tzlocal\win32.py", line 93, in get_localzone
_cache_tz = pytz.timezone(get_localzone_name())
File "E:\Anaconda3\lib\site-packages\tzlocal\win32.py", line 84, in get_localzone_name
raise pytz.UnknownTimeZoneError('Can not find timezone ' + tzkeyname)
pytz.exceptions.UnknownTimeZoneError: 'Can not find timezone '
>>>
以上是输出
from nonebot2.
贴一下 pip list 结果中的 pytz pytzdata tzlocal apscheduler 的版本
from nonebot2.
贴一下 pip list 结果中的 pytz pytzdata tzlocal apscheduler 的版本
APScheduler 3.6.3
pytz 2020.4
pytzdata 2020.1
tzlocal 2.1
from nonebot2.
跟我的版本都一模一样,我执行却都可以...
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from tzlocal import get_localzone
>>> get_localzone()
<DstTzInfo 'Asia/Shanghai' LMT+8:06:00 STD>
>>> from apscheduler.schedulers.asyncio import AsyncIOScheduler
>>> AsyncIOScheduler()
<apscheduler.schedulers.asyncio.AsyncIOScheduler object at 0x0000020F8913BF40>
无法复现..
from nonebot2.
无法复现 +1
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from tzlocal import get_localzone >>> get_localzone() <DstTzInfo 'Asia/Shanghai' LMT+8:06:00 STD> >>> from apscheduler.schedulers.asyncio import AsyncIOScheduler >>> AsyncIOScheduler() <apscheduler.schedulers.asyncio.AsyncIOScheduler object at 0x0000020F8913BF40>
from nonebot2.
https://github.com/regebro/tzlocal/blob/2.1/tzlocal/win32.py#L84
看了一下你的报错,看起来跟这个 2.1 版本的
get_localzone_name
的实现有关,是上游问题。相关issue:
regebro/tzlocal#103建议重设一下本机时区,估计就好了
感谢,确实正常了,需要在控制面板设置时区
from nonebot2.
Related Issues (20)
- Plugin: DG-Lab-Play HOT 1
- 【功能建议】对aliases里面的关键词也设置起始命令 HOT 12
- Plugin: 复读姬+1 PlusOne HOT 10
- Plugin: nonebot-plugin-autotalk HOT 3
- Plugin: nonebot-plugin-webpreview HOT 4
- Plugin: 高优先级关闭信号钩子插件 HOT 3
- Plugin: nonebot-plugin-daily-task HOT 3
- Plugin: nonebot-plugin-daily-task HOT 3
- Check your dependencies Python requirement
- Plugin: ai唱歌 HOT 8
- Plugin: QQShell HOT 13
- Plugin: nonebot-plugin-lynchpined HOT 7
- Plugin: 学园偶像大师算分插件 HOT 8
- Plugin: 颜值评分 HOT 3
- Plugin: nonebot-plugin-multigpt HOT 5
- Plugin: 多模态AI工具 HOT 28
- Plugin: nonebot-plugin-xjie-weather HOT 12
- 连接LLOneBot后无法正常发送消息 HOT 4
- Plugin: nonebot-plugin-figure HOT 3
- Plugin: AnyMate小助手 HOT 30
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nonebot2.