Python
网站 | 备注 |
---|---|
官网下载 | |
Docs | |
中文包管理网站, 英文包管理网站 |
安装
ubuntu
sh
apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
git \
build-essential \
libssl-dev \
libffi-dev \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# 虚拟环境
python3 -m venv /opt/venv
PATH="/opt/venv/bin:$PATH"
国内镜像源
sh
# 阿里云 https://mirrors.aliyun.com/pypi/simple
# 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple
# 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple
# 中国科学技术大学 https://pypi.mirrors.ustc.edu.cn/simple
pip install -i https://mirrors.aliyun.com/pypi/simple some-package
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple
Writing to /Users/chenhang_vendor/.config/pip/pip.conf
pip config list
global.index-url='https://pypi.douban.com/simple/'
Python常用库
库 | 安装 | 常用方法 | 描述 |
---|---|---|---|
lxml | pip install lxml | etree | 解析网页 |
selenium | pip install selenium | webdriver | 获取浏览器驱动 |
fonttools | pip install fonttools | 解析字体库 |