centos pip invalid

Installing and configuring pip3 on CentOS may require the following steps:

  1. Make sure Python 3 is installed correctly: Please make sure you have installed Python 3 correctly. On CentOS, Python 3 may be installed in  /usr/bin/python3 the path by default. You can verify that Python 3 is installed correctly by running the following command:

    python3 --version
    

    If the output shows version information for Python 3, Python 3 is installed correctly.

  2. Install pip3: On CentOS, you can use  yum the package manager to install pip3. Run the following command to install pip3:

    sudo yum install python3-pip
    

    This will install the pip3 tool and its dependencies.

  3. Confirm the path to pip3: On CentOS, the pip3 executable is usually located at  /usr/bin/pip3. You can verify the path to pip3 by running the following command:

    which pip3
    

    If the output shows up  /usr/bin/pip3, the path to pip3 is correct.

  4. Confirm environment variables: Please check whether your environment variables contain the path to pip3. Run the following command to view environment variables:

    echo $PATH
    

    Check whether the path is included in the output  /usr/bin . If it is not included, add the path to pip3 to the PATH environment variable. You can  add the following lines in your ~/.bashrc or  ~/.bash_profile file:

    export PATH="/usr/bin:$PATH"
    

    After saving the file, restart Terminal or Run  source ~/.bashrc or  source ~/.bash_profile for the changes to take effect.

After completing the above steps, you should be able to use pip3 correctly on CentOS. If the problem persists, you may want to refer to the relevant documentation or community support for more detailed guidance and assistance.

This warning is caused by the new version of pip3 changing the output format by default. You can disable this warning or change the output format by following the suggestions in the warning.

Method 1: Use command line options to disable warnings
When running the pip3 command, you can use  --format=legacy options to disable warnings. For example:

pip3 --format=legacy <command>

Replace  <command> with the actual pip3 command you want to run.

Method 2: Disable warnings in the pip.conf file
You can also permanently disable warnings by editing the pip.conf file. Follow these steps:

  1. Open the pip.conf file. If the file does not exist, you can create a new one.

    vi ~/.pip/pip.conf
    
  2. Add the following content to the file:

    [list]
    format=legacy
    

    This will set the output format to legacy in the [list] section, thus disabling warnings.

  3. Save the file and exit.

After completing the above steps, you will not see this warning when you run the pip3 command again.

Please note that this is only a warning and does not affect the functionality of pip3. You can ignore this warning if you wish to maintain the updated output format.

Guess you like

Origin blog.csdn.net/Steven_yang_1/article/details/132835617
pip