Closed homuraLan closed 1 year ago
在python3.10中出现了 ImportError: cannot import name ‘Mapping’ from ‘collections’ (F:\lib\collectionsinit.py) 问题 提醒修复
在我修改文件强行忽略掉这个错误之后又出现了以下错误:
D:\NoneBot2>nb init
[?] Project Name: homura
[?] Where to store the plugin? 2) In a "src" folder
[?] Load NoneBot Builtin Plugin? Yes
[?] Which adapter(s) would you like to use? (<up>, <down> to move, <space> to select, <a> to toggle, <i> to invert)
Traceback (most recent call last):
File "D:\conda_data\envs\Python3.8.15\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\conda_data\envs\Python3.8.15\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\conda_data\envs\Python3.8.15\Scripts\nb.exe\__main__.py", line 7, in <module>
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\nb_cli\__init__.py", line 30, in init
create_project()
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\nb_cli\handlers.py", line 105, in create_project
answers2 = prompt(question2, qmark="[?]", style=list_style)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\PyInquirer\prompt.py", line 69, in prompt
answer = run_application(
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\shortcuts.py", line 625, in run_application
result = cli.run()
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\interface.py", line 415, in run
self.eventloop.run(self.input, self.create_eventloop_callbacks())
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\eventloop\win32.py", line 81, in run
callbacks.feed_key(k)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\interface.py", line 1043, in feed_key
cli.input_processor.process_keys()
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\key_binding\input_processor.py", line 219, in process_keys
self._process_coroutine.send(key_press)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\key_binding\input_processor.py", line 176, in _process
self._call_handler(matches[-1], key_sequence=buffer[:])
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\key_binding\input_processor.py", line 247, in _call_handler
handler.call(event)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\prompt_toolkit\key_binding\registry.py", line 61, in call
return self.handler(event)
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\PyInquirer\prompts\checkbox.py", line 210, in move_cursor_down
_next()
File "D:\conda_data\envs\Python3.8.15\lib\site-packages\PyInquirer\prompts\checkbox.py", line 209, in _next
ic.pointer_index = ((ic.pointer_index + 1) % ic.line_count)
ZeroDivisionError: integer division or modulo by zero
我看到别人 Which adapter(s) would you like to use? 有这些选项,我没有,还会报错
请升级你的nbcli,最新版本是0.6.7
请升级你的nbcli,最新版本是0.6.7
我使用 pip install nb-cli直接安装,环境是新的python没装过别的,换成新的要怎么操作
pip install nb-cli
因为我得到了不太好处理的新错误:
pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyinquirer 1.0.3 requires prompt-toolkit==1.0.14, but you have prompt-toolkit 3.0.33 which is incompatible.
poetry 1.2.2 requires tomlkit!=0.11.2,!=0.11.3,<1.0.0,>=0.11.1, but you have tomlkit 0.10.2 which is incompatible
请不要使用过时的镜像源,删除或更换正常的镜像源后使用pip install --upgrade nb-cli
升级
请不要使用过时的镜像源,删除或更换正常的镜像源后使用
pip install --upgrade nb-cli
升级
清华源
请不要使用过时的镜像源,删除或更换正常的镜像源后使用
pip install --upgrade nb-cli
升级清华源
说的就是清华源,版本落后多少了
请不要使用过时的镜像源,删除或更换正常的镜像源后使用
pip install --upgrade nb-cli
升级清华源
说的就是清华源,版本落后多少了
那用啥
那用啥
多的是啊,阿里腾讯华为中科大交大等等
那用啥
多的是啊,阿里腾讯华为中科大交大等等
已实测,华为,阿里,中科大源均有类似错误,之前我忽视掉了这些错误,现在导致某些插件无法正常导入
那用啥
多的是啊,阿里腾讯华为中科大交大等等
我使用Anaconda创建虚拟python环境
例如
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyinquirer 1.0.3 requires prompt-toolkit==1.0.14, but you have prompt-toolkit 3.0.33 which is incompatible.
poetry 1.2.2 requires tomlkit!=0.11.2,!=0.11.3,<1.0.0,>=0.11.1, but you have tomlkit 0.9.2 which is incompatible.
当我按照要求安装这些包对应版本以后又会出现
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
nonebot2 2.0.0b2 requires tomlkit<0.10.0,>=0.9.0, but you have tomlkit 0.11.1 which is incompatible.
nb-cli 0.6.6 requires prompt-toolkit<4.0.0,>=3.0.19, but you have prompt-toolkit 1.0.14 which is incompatible.
nb-cli 0.6.6 requires tomlkit<0.10.0,>=0.9.0, but you have tomlkit 0.11.1 which is incompatible.
以上错误最后在华为源中复现
升级你的nb2
升级你的nb2
nb-cli 0.6.7 requires tomlkit<0.11.0,>=0.10.0, but you have tomlkit 0.11.6 which is incompatible. 乐 我甚至都找不到这个tomlkit版本
装了个prompt_toolkit-3.0.36 我的建议是你们教程写清楚 ,这玩意儿一般源根本扒不下来,没这东西直接报错
乐,装包还能依赖装不全的
有问题请去 https://discussions.nonebot.dev 这里是bug反馈平台
系统Windows 11