CensoredUsername/unrpyc

No module named 'renpy'

croald opened this issue · 5 comments

With Python 3.12.2 on Mac OS, when I try to run unrpyc.py it immediately errors out:

python ~/dev/renpy/unrpyc/unrpyc.py e1.rpyc 
Traceback (most recent call last):
  File "/Users/cc/dev/renpy/unrpyc/unrpyc.py", line 48, in <module>
    import decompiler
  File "/Users/cc/Library/Mobile Documents/com~apple~CloudDocs/dev/renpy/unrpyc/decompiler/__init__.py", line 24, in <module>
    from .renpycompat import renpy
  File "/Users/cc/Library/Mobile Documents/com~apple~CloudDocs/dev/renpy/unrpyc/decompiler/renpycompat.py", line 26, in <module>
    magic.fake_package("renpy")
  File "/Users/cc/Library/Mobile Documents/com~apple~CloudDocs/dev/renpy/unrpyc/decompiler/magic.py", line 665, in fake_package
    return __import__(name)
           ^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'renpy'

Where is this renpy module supposed to come from? Do I need to install unrpyc somewhere specific so it can read my copy of the renpy SDK?

Pre-renpy8 this used to work for me, but if there's a new dependency I can't seem to find an instruction for dealing with it

Huh, that seems like a repeat of #225. It was related to running python 3.12, and should've been fixed in the last release. Are you running the most recent release?

edit: in regards to your question, no there's no unmet dependency, and it doesn't need to find renpy. We simply put a "fake" renpy module there so that the code can be written as if renpy is present. The mechanism that did that was changed in 3.12, so therefore it needed to be updated.

I pulled the master branch, but looking at the commit history, maybe the #225 fix is still on dev and hasn't been merged over?

edit: Yeah, when I check out the dev branch instead of master, the error is gone.

The relevant commit was 1eae493, which is on master and in the last release. There's only two commits on dev in front of master, neither of which are related to this issue.

I'm very confused why dev would work for you but master won't.

Sourcetree tells me that origin/master is on commit 11de7c0 from April 1. That doesn't seem to match what's actually on github. I don't know why it seems to be out of date, probably something on my end I guess. Maybe I just need to wipe my copy and clone it again. Thanks for your quick responses.

No idea what sourcetree is doing then. But well, seems like this isn't a bug. Good luck!