LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Rest calls on Python node

    Employee
    Posted 10-02-2017 15:38

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rgvenkatesh

    Hi,

    I am trying to put up a design to invoke Rest API calls from a Python node, but on Lavastorm I can see some additional brainNode code present in the Python node.

    However, when I try to use the below code on the Python node, I get the following error:

    Python code for API Call:
    import requests
    url="http://xxxxxxx"

    res=requests.get(url)
    res.status_code


    Error
    ERROR: No module named requests
    Error Code: brain.node.ls.brain.node.brainpython.python2implem entationfile.2

    ERROR: No module named requests
    Error Code: brain.node.NodeMain.cpp.17


    ------------------------------------
    From the error message I guess the requests package is not present which i assumed would be present as part of the Python node.

    Can you guys help me understand how this can be fixed?

    Regards,
    Venkatesh


  • 2.  RE: Rest calls on Python node

    Employee
    Posted 10-02-2017 19:57

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    No, there are hundreds if not thousands of packages available for Python and we only include the official ones from the distro. But, you can load most any package yourself and get to it easily.

    They need to be loaded into this folder:
    <installdir>\platform\windows-x86-64\python\Lib\site-packages for windows
    or
    <installdir>/platform/linux-x86-64/python/lib/python2.7/site-packages for linux

    The framework of code that comes with the python node is used to communicate with the LAE server and provides for reading/writing BRD files, etc.
    If you haven't seen it yet, look at "Python Node Getting Started.pdf" in your docs folder.


  • 3.  RE: Rest calls on Python node

    Employee
    Posted 10-04-2017 09:53

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rgvenkatesh

    Thanks Tony, I was able to get our administrator install the request module. I can access the methods under it now.