![]() |
ModuleNotFoundError: No module named 'pyrlang.gen_server' - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: ModuleNotFoundError: No module named 'pyrlang.gen_server' (/thread-31030.html) |
ModuleNotFoundError: No module named 'pyrlang.gen_server' - Maxximiliann - Nov-19-2020 Please note: Experience level - Beginner # # A simple Python server and an Elixir client sending to it # Python server will reply with its own Pid, so then you know the Pid and can # send to it directly (second send call). # # Run `make example10a` to run Python node # Run `make example10b` to run Elixir client which will perform the call # import logging from term import Atom from pyrlang.gen_server import GenServer from pyrlang import Node from pyrlang import GeventEngine as Engine # from pyrlang import AsyncioEngine as async LOG = logging.getLogger("+++EXAMPLE10+++") logging.getLogger("").setLevel(logging.DEBUG) class MyProcess(GenServer): def __init__(self, node) -> None: GenServer.__init__(self, node.node_name_, accepted_calls=['hello', 'hello_again']) node.register_name(self, Atom('my_process')) LOG.info("registering process - 'my_process'") def hello(self): """ This is called via ``gen_server:call`` """ return self.pid_ @staticmethod def hello_again(): """ This is called from Elixir test after ``hello`` returned success. """ return b'Approved!' def main(): event_engine = Engine() node = Node(node_name="[email protected]", cookie="COOKIE", engine=event_engine) MyProcess(node) event_engine.run_forever() if __name__ == "__main__": main() Pyrlang was installed following the instructions provided here and here. What's causing these errors and how are they correctly resolved? |