External Packages

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.
Post Reply
Message
Author
Rorins
Newbie
Posts: 9
Joined: Sun Jun 21, 2020 7:19 pm
Contact:

External Packages

#1 Post by Rorins »

Hello, I've been trying to install packages for renpy, I first tried installing them with pip command and then i tried copying the content of the package in the GAME folder, but I am having a lot of errors. One is with the "wikipedia" package. I tried with python 3 and it gave me errors, when I uninstalled python 3 and tried with python 2 it still gave me the same error. I had a lot of errors but this is the one where I am stuck right now:

Code: Select all

While running game code:
  File "game/script.rpy", line 10, in script
    $ import wikipedia
  File "game/script.rpy", line 10, in script
    $ import wikipedia
  File "game/script.rpy", line 10, in <module>
    $ import wikipedia
ImportError: No module named htmlentitydefs
I imported the package with Init python, but it seems like it can't find modules...
Is there a special way to install packages? And do they work on renpy 7.4.1? Thank you

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: External Packages

#2 Post by henvu50 »

Did you ever figure out how to install packages?

https://www.renpy.org/doc/html/python.h ... on-modules

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:

Code: Select all

pip install --target game/python-packages requests
What the hell is pip? Does Pip come with Ren'py SDK? Is it an executable? There's no information on what Pip is. I tried running that line of code from scripts.rpy but I get invalid syntax. I need to know what the hell Pip is.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: External Packages

#3 Post by Imperf3kt »

pip is a Linux thing known as a package manager, used to download and install sofrware but you can get it working on Windows. It's not part of renpy.

I can't help much with your specific issue, but I would suggest maybe checking out Wikipedia for a better explanation of what pip is.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: No registered users