Ubuntu安装Python运行环境

免费 - Sunrise - - 浏览量: 1 - 文章来源

安装python和python虚拟环境

$ sudo apt install python3-dev python3-pip libssl-dev build-essential python3-venv

激活虚拟环境

$ mkdir -p /www/python/masonite && cd /www/python/masonite
$ python3 -m venv venv
$ source venv/bin/activate

设置阿里云镜像

$ pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

查看设置的结果

$ pip config list

取消设置

$ pip config unset global.index-url

也可以修改或创建~/.config/pip/pip.conf

[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

查看python版本号

$ python3 --version

谈谈你的看法

请文明发言!