pipinstall 报错:
提示:“You are using pip version 8.1.1, however version 22.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.”
执行pip install --upgrade pip 无效 或者报错。
升级pip:
1.sudo wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
2.sudo python get-pip.py
3.pip -V
升级pip3:
1.sudo wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
2.sudo python3 get-pip.py
3.pip -V
python 升级
下载
wget https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
解压
tar -xzvf Python-2.7.5.tgz
配置python
./configure --prefix=/usr/local/python2.7 --with-ssl --enable-optimizations
编译并安装
make
make install
cd到连接目录:(相当于windos 的path配置的目录)
cd /usr/bin
mv python python.bak
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python
#此处/usr/local/python3路径为步骤2中安装包解压后的路径
python 三方包路径
/usr/local/python2.7/lib/python2.7/site-packages
python 升级导致pip无法使用
1、下载pip 安装包
2、rz 上传到 /usr/local/ 目录
3、解压tar包 cd 进去
4、python setup.py install
5、修改/usr/bin/pip 中的pip版本号。为自己安装的pip版本号。
修复 pip 时候ERROR: Certificate did not match expected hostname: pypi.org
设置主机和url国内镜像源:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com