如何在Windows上安装python-dateutil? [英] How to install python-dateutil on Windows?

查看:186
本文介绍了如何在Windows上安装python-dateutil?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将某些日期/时间转换为UTC,我认为这在Python中会变得非常简单-包括电池,对吗?嗯,这很简单,除了Python(2.6)不包含任何tzinfo类.没问题,快速搜索就会显示 python-dateutil ,它应该可以完全满足我的需求.

I'm trying to convert some date/times to UTC, which I thought would be dead simple in Python - batteries included, right? Well, it would be simple except that Python (2.6) doesn't include any tzinfo classes. No problem, a quick search turns up python-dateutil which should do exactly what I need.

问题是我需要在Windows上安装它.我可以使用7-zip支持.tar.gz2发行版,但是现在我只剩下了一系列文件,而没有任何有关如何进行操作的指导.当我尝试运行setup.py时,出现错误没有名为setuptools的模块".

The problem is that I need to install it on Windows. I was able to upack the .tar.gz2 distribution using 7-zip, but now I'm left with a collection of files and no guidance on how to proceed. When I try to run setup.py I get the error "No module named setuptools".

推荐答案

如果缺少dateutil,请通过以下方式进行安装:

If dateutil is missing install it via:

pip install python-dateutil

或在Ubuntu上:

sudo apt-get install python-dateutil

这篇关于如何在Windows上安装python-dateutil?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆