Results 1 to 3 of 3

Thread: Rest calls on Python node

  1. #1

    Default Rest calls on Python node

    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. #2
    Lavastorm Employee stonysmith's Avatar
    Join Date
    Nov 2006
    Location
    Grapevine Tx
    Posts
    782

    Default

    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. #3

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •