Python练习17-----pytz 模块的安装

pyhon2.7没有时区模块pytz,如果要使用时区相关的函数,需要安装pytz,网上有很多easy_install的方法,本文采用最新的pip安装方法。

pip vs easy_install¶可以查看https://packaging.python.org/discussions/pip-vs-easy-install/#pip-vs-easy-install

easy_install was released in 2004, as part of setuptools. It was notable at the time for installing packages from PyPI using requirement specifiers, and automatically installing dependencies.

pip came later in 2008, as alternative to easy_install, although still largely built on top of setuptools components. It was notable at the time for not installing packages as Eggs or from Eggs (but rather simply as ‘flat’ packages from sdists), and introducing the idea of Requirements Files, which gave users the power to easily replicate environments.

好了,直接上安装pytz,
1、先安装PIP
On Linux or OS X:

    pip install -U pip setuptools

On Windows:

python -m pip install -U pip setuptools

2、安装pytz模块

python -m pip install pytz

3、安装截图如下

这里写图片描述

4、具体安装过程可参考官方文档:
https://packaging.python.org/tutorials/installing-packages/

5、代码验证安装结果:
这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值