ubuntu安装和卸载python3.8

背景:

工作中,可能会分配虚拟机给到开发者,开发者需要在上面调试,开发,打包等操作,依赖python环境。

操作

网上安装步骤很多,但很多文章描述的不够清晰,这篇文章是为数不多的包含完整步骤的指导文章,我已收藏。
第三方博主

安装pipenv报错

安装命令: pip3 install --user pipenv
报错截图:在这里插入图片描述
解决方案:

find / -name lsb_release
rm -rf /usr/bin/lsb_release

安装成功:
在这里插入图片描述

pip配置阿里云镜像源

国内常用镜像源汇总

清华镜像 https://pypi.tuna.tsinghua.edu.cn/simple
中科大镜像 https://pypi.mirrors.ustc.edu.cn/simple
豆瓣镜像 http://pypi.douban.com/simple/
阿里镜像 https://mirrors.aliyun.com/pypi/simple/
华中科大镜像 http://pypi.hustunique.com/
山东理工大学镜像 http://pypi.hustunique.com/
搜狐镜像 http://mirrors.sohu.com/Python/
百度镜像 https://mirror.baidu.com/pypi/simple

Linux

修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url,内容如下:

[global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple

Windows

直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini,内容如下

[global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple

请注意:一定是在你个人用户文件夹下先建立pip文件夹,在建立pip.ini文件,不是直接把pip.ini文件放在C:Usersxx下

猜你喜欢

转载自blog.csdn.net/qq_38923792/article/details/126901284