首页 > 解决方案 > “没有名为集合的模块”ren'py

问题描述

好的,我正在翻译一个游戏,一部名为“katawa shoujo”的视觉小说,确切地说是该游戏的测试版,它不是西班牙语的我得到了测试版文件并将它们移动到 ren'py(它的创建位置)在 ren'py 中运行它时出现此错误:

  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 1, in script
  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 1, in script
  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 2, in <module>
ImportError: No module named sets

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/bootstrap.py", line 326, in bootstrap
    renpy.main.main()
  File "renpy/main.py", line 515, in main
    renpy.game.context().run(node)
  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 1, in script
  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 1, in script
  File "renpy/ast.py", line 923, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2235, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 2, in <module>
ImportError: No module named sets

Windows-10-10.0.19041
Ren'Py 7.4.8.1895
 
Sat Sep 25 20:22:04 2021"

I suppose that the error is in the files of the program by the address of folders that it marks:

```While running game code:
  File "C:\Users\Anthony\Desktop/game/ui_ingamemenu.rpy", line 1, in script"

but it marks that the user is "anthony" but my user is "A" ... I am very lazy with names xd
I don't have much experience so I would like you to help me, thank you


by the way, I use Atom to edit the scripts


If you need the files, I leave a download link for these:
https://www.mediafire.com/file/10ld61gyzipn0ar/Katawa_Shoujo_Beta_%2528Proyecto_de_traduccion%2529.rar/file?fbclid=IwAR14jNyYJbyyhaS6S2XEU2re5zD6Af2plIyhV40F9hH7ammfE_qaRIfJTVs

标签: renpypythomnic3k

解决方案


我会输入它提到的文件并删除行导入集。我猜这是一个非常古老的测试版,对吧?在 Python 的更新版本中,您不再需要导入“set”库,因为它是自动包含的(可以在此处查看)。如果您之前没有编程经验:打开名为“ui_ingamemenu.rpy”的文件。在第 1 行应该有一行写着“导入集”。把那个删掉就行了。但是,如果不知道您正在使用的文件,就很难知道确切的问题。

不过,Renpy 不会一次全部显示错误。它停在它检测到的第一个。所以一旦你解决了这个问题,可能会出现更多。

布埃纳苏尔特 :)


推荐阅读