Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey, I found a fix. It has something to do with python backslash.

So, all you need to do is this: 

fn = fn.replace("\\","/")

Hi. Please help. I'm having  same error issue as Dotdidot -  Which file should I paste the fix into?  Which line, which file?  Dumb question probably but we are just learning.  I hope help a student in my class to complete a project and really want to use this tutorial. 

Thank you

This particular section in example_code.renpy

init python hide:

    import os.path

    import re

    # A list of files we will be scanning.

    files = [ ]

    for i in os.listdir(config.gamedir):

        if i.endswith(".rpy"):

            files.append(os.path.join(config.gamedir, i))

    for fn in files:

        fn = fn.replace("\\","/")

       
        f = renpy.open_file(fn)

        open_examples = set()

        for l in f:

            l = l.decode("utf-8")

            l = l.rstrip()

            m = re.match("\s*#begin (\w+)", l)

            if m:

                example = m.group(1)

                if example in examples:

                    raise Exception("Example %r is defined in two places.", example)

                open_examples.add(example)

                examples[example] = [ ]

                continue

            m = re.match("\s*#end (\w+)", l)

            if m:

                example = m.group(1)

                if example not in open_examples:

                    raise Exception("Example %r is not open.", example)

                open_examples.remove(example)

                continue

            for i in open_examples:

                examples[i].append(l)

        if open_examples:

            raise Exception("Examples %r remain open at the end of %r" % (open_examples, fn))

        f.close()

Thank you so much ! It's working now and it has really helped me understand the Documentation content on layered images. I didn't want to turn up to class on Monday without knowing how to explain layered images. 

I just changed a few lines from 570. 

for fn in files:

        fn = fn.replace("\\","/")

        f = renpy.open_file(fn)

        open_examples = set()

        for l in f:

#no more changes needed, just the above 

 

You're welcome, glad to hear that. 

This worked for me as well. Thank you so much!

(1 edit)

Hey there, I tried your fix and Kaydee's fix but for some reason it still won't work for me. I'm on OS Big sur 11.5.2, I work in old af OS but would this cause an issue? Is the python struggling cuz my OS is old? 

Heres my error mssg, I'm also a newbie to Renpy so be gentle lol
.....

I'm sorry, but an uncaught exception occurred.

While running game code:

  File "game/example_code.rpy", line 556, in script

    init python hide:

  File "game/example_code.rpy", line 556, in script

    init python hide:

  File "game/example_code.rpy", line 556, in <module>

    init python hide:

  File "game/example_code.rpy", line 577, in _execute_python_hide

    f = renpy.open_file(fn)

OSError: Couldn't find file 'Users/imac/Desktop/GAMEDEV/RENPY/LayeredImage Tutorial/game/options.rpy'.

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

Full traceback:

  File "/Applications/renpy-8.0.3-sdk/renpy/bootstrap.py", line 277, in bootstrap

    renpy.main.main()

  File "/Applications/renpy-8.0.3-sdk/renpy/main.py", line 558, in main

    renpy.game.context().run(node)

  File "game/example_code.rpy", line 556, in script

    init python hide:

  File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 441, in raise_

  File "game/example_code.rpy", line 556, in script

    init python hide:

  File "/Applications/renpy-8.0.3-sdk/renpy/ast.py", line 1131, in execute

    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)

  File "/Applications/renpy-8.0.3-sdk/renpy/python.py", line 1061, in py_exec_bytecode

    exec(bytecode, globals, locals)

  File "game/example_code.rpy", line 556, in <module>

    init python hide:

  File "game/example_code.rpy", line 577, in _execute_python_hide

    f = renpy.open_file(fn)

  File "/Applications/renpy-8.0.3-sdk/renpy/exports.py", line 2462, in open_file

    rv = renpy.loader.load(fn)

  File "/Applications/renpy-8.0.3-sdk/renpy/loader.py", line 820, in load

    raise IOError("Couldn't find file '%s'." % name)

OSError: Couldn't find file 'Users/imac/Desktop/GAMEDEV/RENPY/LayeredImage Tutorial/game/options.rpy'.

macOS-10.16-x86_64-i386-64bit x86_64

Ren'Py 8.0.3.22090809

LayeredImage Tutorial 1.0

Wed Apr 26 16:57:21 2023

I think they can't find your options file, aka it's not located in somewhere that's accessible by ren'py

Thanks for the reply , yeah I'm aware! 

It's in the game folder though, so I'm unsure as to why it cant be found.  I'm thinking maybe somewhere along the chain the pc-mac filepath conversion something's messed up. And yea, I opened this in MScode. For some reason I cannot open this in the debug console though. 

FILEPATH ON MY COMPUTER (My RENPY folder is where all my games are living basically):
/Users/imac/Desktop/GAMEDEV/RENPY/LayeredImage Tutorial/game/options.rpy