-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to run wrapper when installed in custom directory for Ren'Py #201
Comments
Hmm. Unfortunately, I'm not familiar with making Ren'Py applications, so I'm not able to reproduce this issue. Did you use As a debugging measure, you can try to modify the relevant code in jinja (in your A similar issue was reported in Anyhow. I believe it's possible for me to make a patch in |
@fantonhike I've created (what I hope is) a fix and released it as a prerelease under version First, remove
Let me know if that changes anything with your issue. |
Thank you so much for the advice, unfortunately the patch doesn't fix the error (although based on what you say it seems like it aught to), and the same message comes up. I did indeed install with And I have looked into the loaders.py file in jinja, but I have so far not managed to find out why it's not finding the template root. I'll keep you updated if I do. In case it helps, here's the full traceback (using the new patch):
I've also read that PackageLoader in jinja can run into difficulty in some cases, and it may be possible to use FileSystemLoader instead? I don't know if that's at all relevant here though. Thank you for the help |
Thank you for assisting in fixing the issue and thanks for the full traceback, that helps a lot. It looks like there's more than one place where I was trying to use Give that a shot @fantonhike |
I believe I'm also getting closer to understanding why Ren'Py applications have this behavior. Ren'Py initializes Python and does some hacks to modify If you wouldn't mind helping me out with some additional information, can you add these lines of code before you call import importlib.util
from importlib import import_module
import_module('ahk')
spec = importlib.util.find_spec('ahk')
print('origin', spec.origin)
print('submodule_search_locations', spec.submodule_search_locations) |
Thank you so much!! You have my immense gratitude. The new patch fixes the issue, it seems to work completely fine now. I'm more than happy to help with getting more information on how Ren'Py works. I added the code but it seems that it doesn't manage to retrieve anything. (Or maybe it's a problem with how I'm outputting the print function? I saved the print output to a text file from the game's script, as I didn't figure out how to run it from a command line)
|
Thanks. Glad the workaround is working for you. I will publish version 1.1.3 with this fix shortly. As for the Ren'Py issues... It seems like Ren'Py's In [2]: import_module('ahk')
spec = importlib.util.find_spec('ahk')
In [3]: spec.origin
Out[3]: 'c:\\users\\spencer\\venv\\lib\\site-packages\\ahk\\__init__.py'
In [4]: spec.submodule_search_locations
Out[4]: ['c:\\users\\spencer\\venv\\lib\\site-packages\\ahk']
In [5]: ahk.__spec__
Out[5]: ModuleSpec(name='ahk', loader=<_frozen_importlib_external.SourceFileLoader object at 0x000001E7E98FAA00>, origin='c:\\users\\spencer\\venv\\lib\\site-packages\\ahk\\__init__.py', submodule_search_locations=['c:\\users\\spencer\\venv\\lib\\site-packages\\ahk']) As observed when Ren'Py loads the package, the spec is not correct: >>> ahk.__spec__
ModuleSpec(name='ahk', loader=<__main__.RenpyImporter object at 0x000001B32188E890>) I'm not familiar enough Ren'Py to know how to fix this issue, but it's probably worth filing an issue with the Ren'Py project. In any case, I think this change was needed for the intended fallback system to work anyhow, so I'm glad that you brought this up. I'm sure it will help others who are packaging |
fix released in v1.1.3 🎉 |
I've filed an issue with Ren'Py about this and will followup as necessary. renpy/renpy#4644 |
Hello,
apologies if this is not the right place for this question, but I can't figure it out.
I'm trying to use the wrapper for a game made with Ren'Py. Normally it can use 3rd party modules from a folder called 'python-packages' in the game's directory (it works fine with the keyboard module, for example). However when I try to run it, it gives me the error for the line
ahk = AHK()
:I tried with 1.1.0, .2 and .3 but all 3 gave the same result. Re-installing ahk and python didn't do anything either.
Thanks
The text was updated successfully, but these errors were encountered: