CensoredUsername / unrpyc

A ren'py script decompiler
Other
861 stars 156 forks source link

ModuleNotFoundError: No module named 'util' #126

Closed AnCaLu closed 3 years ago

AnCaLu commented 3 years ago

When I trying to decompile the file I get this error.

Traceback (most recent call last):
  File "D:\tutorial renpy\unrpyc-master\unrpyc.py", line 49, in <module>
    import decompiler
  File "D:\tutorial renpy\unrpyc-master\decompiler\__init__.py", line 22, in <module>
    from util import DecompilerBase, First, WordConcatenator, reconstruct_paraminfo, \
ModuleNotFoundError: No module named 'util'

I used this: python "D:\tutorial renpy\unrpyc-master\unrpyc.py" -c --init-offset "D:\tutorial renpy\DDLC-1.1.1-pc\game\cgs.rpyc"

AnCaLu commented 3 years ago

After some testing I found the solution. You must put the complete path to the python program in the game

It would be something like this. "D:\tutorial renpy\DDLC-1.1.1.1-pc\lib\windows-i686:\python.exe" "D:\tutorial renpy\unrpyc-master\unrpyc.py" -c --init-offset "D:\tutorial renpy\DDLC-1.1.1.1-pc\game\cgs.rpyc"

mscansian commented 3 years ago

Using python2.7 worked for me

mwalimu59 commented 2 years ago

I encountered the same issue. As the above poster said, installing Python 2.7 and running with it worked. That said, it seems like someone should look into why the problem occurs with Python 3.x and either fixing it or telling us how to get around it.

madeddy commented 2 years ago

... it seems like someone should look into why the problem occurs with Python 3.x ...

Its somewhat mentioned in the readme.md passage "Usage", first line and somewhat useful is the passage "Notes-on-support". So, there is no need to look into this: unrpyc runs as of now exclusively on python 2.7 because RenPy did it up to four weeks ago(late june22).

It will be some work needed to get unrpyc running with the new RenPy 8.x and 7.5.x because all the changes on RenPy since the 7.4.x versions.

mwalimu59 commented 2 years ago

Okay, I see now that it mentions "Python 2.7". When I see something like that my mind tends to interpret it as "2.7 or later", which is okay 99% of the time. This is one of those rare cases where it doesn't work with newer versions. I think it bears highlighting that you must use 2.7 as it may not work with newer versions of Python (at least in a Windows environment).

(RenPy version wasn't an issue in my case, as the VN I was trying to run it with used RenPy 6.10.2e, and in any case I was getting the error running 'python unrpyc.py --help' with no file specified.)