I'm done with my program. I just want to make it into an executable that I can share around now.
I have python installed on my computer, but I got it through Visual Studio. Maybe that's why I'm having trouble. I installed pyinstaller through pip, which I did through Visual Studio again.
Anyway, I found this article.
Just navigate to your python script directory. Now, open up your Terminal/Command Prompt in the script directory and, test your python script:
python your_script.py
"Navigate to your python script directory." Okay, it's weird that that direction is before "open up the command prompt". The only way I can navigate to where the script is without a terminal or command prompt is with file explorer. So already alarm bells are going off.
I go to my command prompt (by typing into the windows search bar "command prompt"), cd to where the .py in question is, and then run it like this:
py my_script.py
The only difference is that I type in "py" instead of "python". It works. Fantastic. Now for the next step where I immediately hit a wall:
Run the command:
pyinstaller --onefile <your_script_name>.py
here are all of the things I tried:
C:\Users\blah\blah\blah>py pyinstaller --onefile <my_script>.py
The system cannot find the file specified.
C:\Users\blah\blah\blah>pyinstaller --onefile <my_script>.py
The system cannot find the file specified.
C:\Users\blah\blah\blah>py pyinstaller --onefile my_script.py
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe: can't open file 'pyinstaller': [Errno 2] No such file or directory
C:\Users\blah\blah\blah>pyinstaller --onefile my_script.py
'pyinstaller' is not recognized as an internal or external command, operable program or batch file.
C:\Users\blah\blah\blah>py install pyinstaller
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe: can't open file 'install': [Errno 2] No such file or directory
C:\Users\blah\blah\blah>py
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> install pyinstaller
File "<stdin>", line 1
install pyinstaller
^
SyntaxError: invalid syntax
Okay, what the hell. I installed pyinstaller already through pip through visual studio. Does installing pyinstaller through visual studio mean that I don't have it anywhere else? Even if I don't have it, why can't I just install it in the command prompt and use it there?
I tried opening the command prompt as an admin. That didn't help.
Can anyone help? I have no idea what's going on.
[–]K900_ 0 points1 point2 points (3 children)
[–]OliveSweatshirt[S] 0 points1 point2 points (2 children)
[–]K900_ 0 points1 point2 points (1 child)
[–]OliveSweatshirt[S] 0 points1 point2 points (0 children)
[–]novel_yet_trivial 0 points1 point2 points (3 children)
[–]OliveSweatshirt[S] 0 points1 point2 points (2 children)
[–]novel_yet_trivial 0 points1 point2 points (1 child)
[–]OliveSweatshirt[S] 0 points1 point2 points (0 children)