Python File to EXE Not working. - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Python File to EXE Not working. (/thread-27484.html) |
Python File to EXE Not working. - MianDoesCoding - Jun-08-2020 Hey guys so i would i like to make a single python file of mine into an exe what i do is i save he file in a folder with nothing else and i go to the folder Then i click on the direction thing and type cmd to open command prompt. i then type pyinstaller --onefile -w main.py it comes up with this but in the cmd promt color. I am super stuck as it makes the dist, build and main.text files but when i click on them there is nothing in em. Can someone help? Thanks! RE: Python File to EXE Not working. - buran - Jun-08-2020 you need to provide full path to main.py or cd current working directory to be the one where the py file is. cmd will not start in the folder where the py file is by default. As you can see it looks into C:\Users\mians
RE: Python File to EXE Not working. - MianDoesCoding - Jun-08-2020 (Jun-08-2020, 01:08 PM)buran Wrote: you need to provide full path to main.py or cd current working directory to be the one where the py file is. so i would have to list the whole path? like /documents/tests/wtiter/main.py? RE: Python File to EXE Not working. - buran - Jun-08-2020 (Jun-08-2020, 01:11 PM)MianDoesCoding Wrote: so i would have to list the whole path?yes, that is one option - use full path (either absolute or relative). the other is to change current working directory to the one where the files is, in which case you don't have to use the full path RE: Python File to EXE Not working. - MianDoesCoding - Jun-08-2020 (Jun-08-2020, 01:19 PM)buran Wrote:(Jun-08-2020, 01:11 PM)MianDoesCoding Wrote: so i would have to list the whole path?yes, that is one option - use full path (either absolute or relative). the other is to change current working directory to the one where the files is, in which case you don't have to use the full path How would i change the directory sir? RE: Python File to EXE Not working. - buran - Jun-08-2020 cmd will open like this that is assuming the file is in C:\Users\mians\Documents\tests\writer
RE: Python File to EXE Not working. - MianDoesCoding - Jun-08-2020 (Jun-08-2020, 01:26 PM)buran Wrote: cmd will open like this it is in thispc then Desktop, then Python And then text editor. and in the text editor folder is the main.py and im stuck on exactly what to write sir RE: Python File to EXE Not working. - buran - Jun-08-2020 (Jun-08-2020, 01:30 PM)MianDoesCoding Wrote: it is in thispc then Desktop, then Python And then text editor. and in the text editor folder is the main.py (Jun-08-2020, 01:11 PM)MianDoesCoding Wrote: like /documents/tests/wtiter/main.py? And I am confused by your explanations... What is the full path of main.py? RE: Python File to EXE Not working. - NectDz - Jun-08-2020 Go on the folder where the file is saved then you see the path to the file ontop, click on it and erase the path and just type cmd and enter and cmd will open up. Now you should be able to do what you wanted to do on pyinstall RE: Python File to EXE Not working. - MianDoesCoding - Jun-09-2020 (Jun-08-2020, 02:31 PM)NectDz Wrote: Go on the folder where the file is saved then you see the path to the file ontop, click on it and erase the path and just type cmd and enter and cmd will open up. Now you should be able to do what you wanted to do on pyinstall thats what i did |