Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
"Ren'Py can import pure-Python modules and packages. First-party modules and packages – ones written for the game – can be placed directly into the game directory. Third party packages can be placed into the game/python-packages directory. For example, to install the requests package, one can change into the game's base directory, and run the command:"
No matter what variation of pip install I try, it always gives an invalid syntax error?
EDIT:
I've learned Pip is something you run from Python, but don't know how yet.
I think it means I need Python installed.
I've installed python-2.7.18.msi from here: https://www.python.org/downloads/release/python-2718/
I've run python.exe from c:\python27 and now I have a >>> prompt open. From here, I think I'm supposed to follow the instructions:
one can change into the game's base directory, and run the command: pip install --target game/python-packages requests
This is where I'm confused. I'm at the >>> prompt and have no idea how to change into a game's base directory to run the pip command.
You got confused. pip is a command-line tool, use it from a command prompt or terminal, not from within Python.
(It can also be used from within Python because it's really just a Python module, but that's more complicated and another story.)
But what are you even doing with pip in the context of Ren'Py? Ren'Py has its own embedded Python interpreter, you can't add extra modules to it that way. Even if you could, it would have to be its own private pip, not the one that comes with your system-wide interpreter.
felix wrote: ↑Thu Apr 22, 2021 2:02 am
You got confused. pip is a command-line tool, use it from a command prompt or terminal, not from within Python.
I eventually figured this out. I ended up copying pip.exe to my game folder and using it from there.
But what are you even doing with pip in the context of Ren'Py? Ren'Py has its own embedded Python interpreter, you can't add extra modules to it that way. Even if you could, it would have to be its own private pip, not the one that comes with your system-wide interpreter.
Certain software requires I use pip to install a WHL file for use in python language environment. I think because Ren'py has embedded Python interpreter, that's the only reason I'm able to use this WHL installed via PIP.