Python Forum
ModuleNotFoundError: No module named 'pyrlang.gen_server'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'pyrlang.gen_server'
#1
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()
Error:
maxximiliann@Maxximiliann:~/Pyrlang-master$ make example10a PYTHONPATH=~/Pyrlang-master:~/Pyrlang-master/../Term PYRLANG_ENABLE_LOG_FORMAT=1 PYRLANG_LOG_LEVEL=DEBUG python3 examples/elixir/e10.py Native term ETF codec library import failed, falling back to slower Python impl Traceback (most recent call last): File "examples/elixir/e10.py", line 13, in <module> from pyrlang.gen_server import GenServer ModuleNotFoundError: No module named 'pyrlang.gen_server' make: *** [Makefile:69: example10a] Error 1
Pyrlang was installed following the instructions provided here and here.

What's causing these errors and how are they correctly resolved?
Reply


Messages In This Thread
ModuleNotFoundError: No module named 'pyrlang.gen_server' - by Maxximiliann - Nov-19-2020, 01:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 900 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,835 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,607 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,470 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,535 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,353 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,052 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 9,156 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,026 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,877 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020