Rest calls on Python node
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
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
-
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.
Please sign in to leave a comment.
Comments
2 comments