Free installation version python install pip module

Free installation version python install pip module.md

Free installation of python

Download a portable Python version

Go to the download page of the official Python website , select a suitable portable version (for example, Python 3.8.12 64-bit compact version) in the "Looking for a specific release?" drop-down menu, and download the corresponding compressed file (format) zip.

insert image description here

Unzip the portable Python version

After the download is complete, unzip the compressed file to your desired directory, such as C:\PortablePython.

run portable python

Enter the decompressed folder, find an python.exeexecutable file named in the folder, and double-click to run it. This will start a command-line terminal, use this terminal to run your Python script. If you want to run pythoncommands directly through the command line, you need to configure pathenvironment variables and add pythonthe installation path pathto the bottom:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-dM0uFewe-1692771194372) (C:\Users\tengwang8\AppData\Roaming\Typora\typora-user-images\ image-20230823095317490.png)]

Open it again cmdand runpython --version
insert image description here

If the version is good, the configuration is successful.

Install the pip module

Use the built-in ensurepip installation

In a command-line terminal, enter the following command to install the pip module:

python -m ensurepip

Mode installation using get-pip.py

  1. Download the get-pip.py script : Open a browser, go to the https://bootstrap.pypa.io/get-pip.py link, right-click the "Raw" button on the page, and select "Save As" to save this script file . Save it to your desired directory, eg C:\Temp\get-pip.py.

  2. Run the get-pip.py script : Open a terminal, navigate to get-pip.pythe directory where you saved , and run the following command to install pip:

    python get-pip.py
    

    If you have multiple Python versions, make sure to run this command with the correct version. You can python3specify a specific version of the Python interpreter using the or full path.

  3. Verify pip installation : After the installation is complete, you can run the following command to verify pipthat it has been successfully installed:

    pip --version
    

    If no error message appears, the installation piphas been successful.

Guess you like

Origin blog.csdn.net/wagnteng/article/details/132451256