Runtime error in python - replit: input(): lost sys.stdin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Runtime error in python - replit: input(): lost sys.stdin

Hi, everyone. I'm trying to solve a problem in python3. The thing is that I have to solve it on replit. When I run the code, it works, but when I run the tests, they don't pass and it appears Runtime error : input(): lost sys.stdin The problem is: Make the fibonacci sequence. The user must input the number from 0 to 99. The program must show the fibonacci sequence based on the input of the user. The tests put the number in letters (e.g. seven), so I used the word2number package to solve this part. This is the code that I used: https://code.sololearn.com/cGs41HFo6bvo/?ref=app I don't know how to import a package in sololearn, so if you run it through the sololearn platform it won't work because it can't import the package but if you put it in replit you will see the error. By the way, this problem must be solved in replit (no other IDEs are allowed). I hope someone can help me, please! :'(

22nd Aug 2022, 3:08 PM
VAl
VAl - avatar
4 Answers
+ 1
Put this in front of your program to do an import: __import__("os").system("pip --quiet install word2number -q") it gives me a range of numbers when i input seven. It looks good.
22nd Aug 2022, 3:33 PM
Paul
Paul - avatar
0
I did the import you suggested but it appears ModuleNotFindError
22nd Aug 2022, 3:52 PM
VAl
VAl - avatar
0
You missed a space after pip
22nd Aug 2022, 3:54 PM
Paul
Paul - avatar
0
Yeah, now I could make the import. Thank you! The bad thing is that it doesn't pass the replit tests which are: "seven", "fourteen", "random_0_99" That's where appears the n=input() RuntimeError: input(): lost sys.stdin :(
22nd Aug 2022, 4:00 PM
VAl
VAl - avatar