Closed gioargyr closed 4 years ago
Hello @gioargyr did you re-build/push/deploy the function after adding the requests
package to the requirenments.txt
?
Also when building the function try running faas-cli build .... --no-cache
and let me know if it helps.
Hello, as it seems it was a stupid mistake because I didn't add "import requests". So sorry for bothering you.
No problem :+1:
In Lab3, I cannot understand how exactly should I modify the function "astronaut-finder". I see that I have to modify "requirements.txt" and I did bu just adding the word "requests" (even though it seemed strange to me), but now that I run the function I get an error. I am pretty sure that it has to do with the modification of the file "requirements.txt" or a modification I didn't do correctly.
Expected Behaviour
The function is supposed to return a name of an astronaut in ISS
Current Behaviour
The error I get is: " exit status 1 Traceback (most recent call last): File "index.py", line 19, in
ret = handler.handle(st)
File "/home/app/function/handler.py", line 6, in handle
r = requests.get("http://api.open-notify.org/astros.json")
NameError: name 'requests' is not defined
"
Possible Solution
N/A
Steps to Reproduce (for bugs)
I just follow the instructions on Lab3.
Context
I just try to do Lab3
Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
): 0.11.8Docker version ( Full output from:
docker version
): 19.03.4Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)? Kubernetes
Operating System and version (e.g. Linux, Windows, MacOS): Debian 10.3
Link to your project or a code example to reproduce issue: