Closed WendaoLee closed 2 years ago
请试试新版
请试试新版
您好,同样是通过Git获取最新版本(765e7aad574d9706ed32a990e7eb4662f3eaf87d),依然出现SyntaxError: invalid syntax错误。报错如下:
async def run(user: BiliUser): ^ SyntaxError: invalid syntax
已根据文档说明通过pip设置了requirement.txt中列出的包:
Requirement already satisfied: aiohttp in c:\python39\lib\site-packages (from -r requirements.txt (line 1)) (3.8.0) Requirement already satisfied: toml in c:\python39\lib\site-packages (from -r requirements.txt (line 2)) (0.10.2) Requirement already satisfied: apscheduler in c:\python39\lib\site-packages (from -r requirements.txt (line 3)) (3.8.1) Requirement already satisfied: attrs>=17.3.0 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (21.2.0) Requirement already satisfied: charset-normalizer<3.0,>=2.0 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (2.0.7) Requirement already satisfied: multidict<7.0,>=4.5 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (5.2.0) Requirement already satisfied: yarl<2.0,>=1.0 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (1.7.2) Requirement already satisfied: frozenlist>=1.1.1 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (1.2.0) Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (4.0.0) Requirement already satisfied: aiosignal>=1.1.2 in c:\python39\lib\site-packages (from aiohttp->-r requirements.txt (line 1)) (1.2.0) Requirement already satisfied: typing-extensions>=3.6.5 in c:\python39\lib\site-packages (from async-timeout<5.0,>=4.0.0a3->aiohttp->-r requirements.txt (line 1)) (3.10.0.2) Requirement already satisfied: idna>=2.0 in c:\python39\lib\site-packages (from yarl<2.0,>=1.0->aiohttp->-r requirements.txt (line 1)) (3.3) Requirement already satisfied: tzlocal!=3.*,>=2.0 in c:\python39\lib\site-packages (from apscheduler->-r requirements.txt (line 3)) (4.1) Requirement already satisfied: pytz in c:\python39\lib\site-packages (from apscheduler->-r requirements.txt (line 3)) (2021.3) Requirement already satisfied: six>=1.4.0 in c:\python39\lib\site-packages (from apscheduler->-r requirements.txt (line 3)) (1.16.0) Requirement already satisfied: setuptools>=0.7 in c:\python39\lib\site-packages (from apscheduler->-r requirements.txt (line 3)) (56.0.0) Requirement already satisfied: tzdata in c:\python39\lib\site-packages (from tzlocal!=3.*,>=2.0->apscheduler->-r requirements.txt (line 3)) (2021.5) Requirement already satisfied: pytz-deprecation-shim in c:\python39\lib\site-packages (from tzlocal!=3.*,>=2.0->apscheduler->-r requirements.txt (line 3)) (0.1.0.post0)
但是依然出现这个错误。电脑重启后依然如此。是有漏导入包的问题吗?
你电脑环境问题吧
你电脑环境问题吧
是的。刚刚放到服务器上试了一下,没问题了。谢谢了,辛苦了。
如果按照utf8编码,则会出现:
print(f"杩愯鍑洪敊:{repr(e)}") ^ SyntaxError: invalid syntax
运行环境为python3.9.6。