# pip3安装问题 **Repository Path**: javychen-cn/pip3 ## Basic Information - **Project Name**: pip3安装问题 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-10-27 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pip3安装问题 ## 1、直接在命令终端输入:pip3 ```shell raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application ``` ## 2、更新pip: ```shell % sudo python -m pip install -U pip ``` ### 结果提示如下: ```shell subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1. ``` ## 3、查找lsb_release的位置: ```shell % find / -name lsb_release ``` ### 结果提示如下: ```shell /usr/bin/lsb_release ``` ## 4、删除lsb_release: ```shell % sudo rm -rf /usr/bin/lsb_release ``` ## 5、再次更新pip: ```shell % sudo python -m pip install -U pip ``` ### 结果提示如下: ```shell Successfully uninstalled pip-19.0.3 Successfully installed pip-20.2.4 ``` #### 20.2.4就是新的pip版本号 ## 6、修改默认的版本号: ```shell % sudo vim /usr/bin/pip3 ``` ### 把里面的pip==修改如下: ```shell #!/usr/bin/python3 # EASY-INSTALL-ENTRY-SCRIPT: 'pip==20.2.4','console_scripts','pip3' __requires__ = 'pip==20.2.4' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pip==20.2.4', 'console_scripts', 'pip3')() ) ``` ### 修改完保存退出,然后就可以用pip3安装python需要的模块了 ### 如安装pygame: ```shell % pip3 install pygame ``` ### 注意:python3.8以上不支持pygame,所以本处默认用python3.7