Advertisement

ubuntu安装和卸载python3.8

阅读量:

背景:

In the process, sometimes virtual machines are allocated to developers for use. Developers need to perform debugging, coding, and packaging operations on these virtual machines. All these operations are carried out within a Python environment.

操作

网上安装步骤繁多,在众多文章中并不是每个都描述得足够清晰;然而,在众多文章中,并非每个都描述得足够清晰;然而,在众多文章中,并非每个都描述得足够清晰;然而,在众多文章中并不都是如此清晰;因此我将其收藏以便后续参考

安装pipenv报错

安装命令: pip3 install --user pipenv
报错截图:

在这里插入图片描述

解决方案:

复制代码
    find / -name lsb_release
复制代码
    rm -rf /usr/bin/lsb_release

安装成功:

在这里插入图片描述

pip配置阿里云镜像源

国内常用镜像源汇总

清华大学官方Python包访问入口:https://pypi.tuna.tsinghua.edu.cn/simple
中国科学技术大学官方Python包访问入口:https://pypi.mirrors.ustc.edu.cn/simple
豆瓣公共资源平台上的Python包访问入口:http://pypi.douban.com/simple/
阿里云天池镜像站点:https://mirrors.aliyun.com/pypi/simple/
华中科技大学独特的Python包分发站点:http://pypi.hustunique.com/
山东理工大学官方Python包访问入口:http://pypi.hustunique.com/
搜狐网络官方Python包访问入口:http://mirrors.sohu.com/Python/
百度网络官方Python包访问入口:https://mirror.baidu.com/pypi/simple

Linux

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

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

Windows

为了方便地设置Python环境,在用户目录下建议创建一个专门的pip目录。例如,在Windows系统中,默认用户的安装路径通常位于'C:\Users\Username'。随后,请根据以下步骤新建名为' pip.ini '的配置文件,并按照指定的内容进行填写

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

请务必确保您首先在个人用户目录下创建一个pip文件夹,并在此基础上构建pip.ini文件。而不是直接将它放置在C:\Users<username>目录下。

全部评论 (0)

还没有任何评论哟~