input gives me an error everytime I try to start the .exe file
Error:
Traceback (most recent call last):
File "working.py", line 58, in <module>
RuntimeError: input(): lost sys.stdin
I tried to make a little afk bot and it worked in my terminal so I decided to do it in an .exe file which gives me an error everytime I try to execute it.
I expected that the .exe file open the terminal and that the code works perfectly fine, but sadly it didn't.
Line 58:
input('Moechtest du wirklich das programm starten, wenn ja druecke die ENTER Taste!')
I'm using Python 3.11 and auto-py-to-exe to convert .py to .exe file.
Related
I am trying to make a program using PySimpleGUI and whenever I run it as a .py (Python) file I get 0 errors and it runs exactly how I want it to, but when I use pyinstaller to compile the .py file to an EXE I get this error:
Traceback (most recent call last):
File "guitest.py", line 2, in <module>
ModuleNotFoundError: No module named 'PySimpleGUI'
[14792] Failed to execute script guitest
I am not sure why it is saying that, I have it installed. As I said before as long as it's a .py file it runs perfectly.
In an Ubuntu environment, I am hosting a script on a web server and I'm trying to run the script without writing it to a file using the line wget -O - -o /dev/null 0.0.0.0:8000/myscript | python
The script starts off running just fine, until I get to a use of input() where I get this error
Traceback (most recent call last):
File "<stdin>", line 629, in <module>
EOFError: EOF when reading a line
I did a little reading on sys.stdin but I'm not finding a clear solution. What can exactly is happening here and how can I work around it?
Found the solution here: Pipe input to Python program and later get input from user
I added the line sys.stdin = open("/dev/tty") and now it seems to work.
Hi everyone so I have some python code I am trying to run from my terminal (will not work in an IDE) to take a .mp3 file and classify the genre of the song based on the Spectrogram that we are using the librosa library plugin for. The code is from this gitHub: https://github.com/cetinsamet/music-genre-classification .When I use the command prompt specified by the gitHub user who created this app I get this error in my terminal:
(base) Nicos-MacBook-Pro:src nico$ python3 get_genre.py ../test.mp3
Traceback (most recent call last):
File "get_genre.py", line 61, in <module>
main(sys.argv[1:])
File "get_genre.py", line 30, in main
net.load_state_dict(torch.load(MODELPATH, map_location='cpu'))
File "/Users/nico/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 419, in load
f = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '../utils/net.pt'
Here is the command line specified: $ python3 get_genre.py ../test.mp3
The error message quite plainly tells you that the code depends on having a file ../utils/net.pt
My lab used python 2.7 with pygame with a program and I'm trying to run it on my computer with no success. Things I've tried:
(1) Installing Python 2.7 and pygame on Windows 10. The program just crashes when I run it with IDLE.
(2) Running a virtual system with ubuntu and installing IDLE, Python 2.7, pygame, etc.
(a) If I open IDLE and open the file Output.py
(b) If I open a shell and type
python /home/frank/Dropbox/clab/Maze_2.2/Output.py
Then I get the following error
python /home/frank/Dropbox/clab/Maze_2.2/Output.py Traceback (most
recent call last):
File "/home/frank/Dropbox/clab/Maze_2.2/Output.py", line 11, in
from Output2d import *
File "/home/frank/Dropbox/clab/Maze_2.2/Output2d.py", line 8, in
import ReadFile
File "/home/frank/Dropbox/clab/Maze_2.2/ReadFile.py", line 44, in
print get_mins()
File "/home/frank/Dropbox/clab/Maze_2.2/ReadFile.py", line 37, in
get_mins handle = open(INPUT_FILE, 'r')
IOError: [Errno 2] No such file or directory: 'data/prob.txt'
The file prob.txt is present and is not corrupt so I'm really unsure what to do next to troubleshoot this issue
This is not a pygame issue, you are just missing some data files of the game Maze: Maze_2.2/data/*
A file named data/prob.txt, you should find it
This is my script
removed
it works fine through terminal but when i make it a .app with Platypus i get this when running the app
Hello How are you?
Traceback (most recent call last):
File "/Users/shameer/Desktop/Test Programs/questions.app/Contents/Resources/script", line 2, in <module>
feeling = raw_input()
EOFError: EOF when reading a line
Platypus doesn't create an interactive terminal session, it just pipes your script output into a textfield. You won't be able to wrap interactive programs with it.