简体   繁体   中英

How can I install pyinstaller?

I'm using vscode. There's a code that I'm gonna turn into (.exe). But before that I have to install pyinstaller. There's an error which I think says that I can not use 'pip'. I've written this code in the terminal: pip install pyinstaller . I've used pip3 install pyinstaller too. And now... this is the error:

What should I do? How can I use pip package? And how can I install pyinstaller and then do the thing I want?

Try to redownload python and make sure that in the downloader, you pick to install pip as well. I don't know what software you may use, but with IDLE, there is an option in the installer to install pip when you go to download. I had trouble with this as well when I was trying to make an executable file. Installing pip through the downloader seemed to fix it.

If your pip is not added to path, go the advanced system settings > environment variables > click on path in the second part > then click on edit > click on new > add path of the scripts folder in python (Most probably in Program files) > click on ok.

It should have the following. I have python 3.8.6:

C:\Program Files\Python3.8.6\Scripts\

C:\Program Files\Python3.8.6\

If pip is not installed, search Add or Remove Programs > Navigate to Python > Click on it > Modify > the click on modify > select checkbox next to pip > click 'ok'.

If this doesn't work, you need to re-install python.

Check if you have pip installed by going opening cmd and typing pip help . If you do not have it installed an error will show up.

How to install Pip on Windows:

1.Get the get-pip.py file - https://bootstrap.pypa.io/get-pip.py

Download the file and save it anywhere you want, just remember where you saved it as you will need the path later.

2.Open cmd. (If you get an error during the installation you might wanna try to run it as administrator)

Use the cd command followed by a folder name to navigate to the location of the get-pip.py file.

Now run python get-pip.py in your cmd.

And you'll have pip installed.

There might be a problem if you have multiple Python instances installed, check back here if that solution doesn't work.

Step 1

Okay, so you first need to check if pip is installed or not by going to the folder where you installed python inside of the bin directory you should find pip.exe if yes then pip is installed, if not then you have to manually download it.

Donwloading pip

Go to get-pip.py and download the file and then save it inside of the bin directory where you installed python then later you need to run the command,

$ python C:\path_to_python_bin_dir\get-pip.py

it will start installing it.

Step2

Once the pip is fully installed ( pip.exe file in you bin folder) you have to run the following command in command prompt.

$ set PATH=%PATH%;C:\path_to_python_bin_dir\

and that's it reload the command prompt and type pip this time there won't be an error saying pip is not recognized as an internal or external command.

I guess you are on windows because the picture you uploaded is of cmd , so for windows you have to follow the steps mentioned above.

In many cases we have pip installed but not added to the environment path this is how to add something to environment path using cmd .

Ensure the installation folder of python and the Script folder inside of it was added to the environment variables. Such as:

C:\Users\{UserName}\AppData\Local\Programs\Python\Python38-32
C:\Users\{UserName}\AppData\Local\Programs\Python\Python38-32\Scripts

Execute python get-pip.py to install(or update) pip. Then reopen the cmd to check whether the pip was installed successful with command pip --version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM