pip install PyInstaller 'pip' is not recognized as an internal or external command, operable program or batch file.

How to package a python project and generate an .exe file? ?

I need to package a python project to generate an .exe file. When I open a command prompt window and type --> pip install PyInstaller, I find that 'pip' is not recognized as an internal or external command, an operable program or batch file.

Entering the command prompt window in the python 3.11 directory will not work, unless you can find the stdin folder, enter the command prompt window in the folder and enter the download and installation command written below. (However, I searched for a long time and could not find the stdin folder. So, I packaged the project in PyCharm)

 (1) Enter in PyCharm --> pip install PyInstaller

Something went wrong and a big red ERROR appeared (it doesn’t matter, please continue)

(2) Enter according to the prompts --> python.exe -m pip install --upgrade pip

 Enter (multiple times) --> python.exe -m pip install --upgrade pip, and there will still be a string of red and blue.

(But it shows Requirement already statisfied. So I guess it has been completed and can I go to the next step??)

(3) So I typed again --> pip install PyInstaller to verify

There are no red and blue strings, no ERROR but it prompts that the python version needs to be updated (no impact, continue below).

(4) So the conjecture is verified, then enter --> Python -m ensurepip enter --> pip install PyInstaller

There is still no problem with this step, although it will prompt a [notice] version update, but as long as it does not affect it, you can continue

(5) Next enter --> pyinstaller -F + the path to the .py file you need to package

completed successfully Perfect, the .exe file was built successfully, and the path to the executable file is displayed

 (6) First copy the system .txt file to the exe folder. You can directly click the .exe file to run it.

During college, I always wanted to learn Python. Although I graduated this time, I still want to continue learning and researching. When I was in school, I couldn't learn Java or C at all. After going through this crazy torture of independently making a graduation project, I actually felt like learning these computer languages! ! !

Therefore, this is also my first time to graduate, study on my own, and come into contact with python. Simply incredible! ! ! ! !

[Note: If the page makes you feel uncomfortable, please include more differences between people, just a side dish contestant. If there is anything wrong, please correct me. / cup fist/ cup fist]

Guess you like

Origin blog.csdn.net/qq_51358596/article/details/132524964