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

查看:39
本文介绍了如何在 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 上:

Or on Ubuntu:

sudo apt-get install python-dateutil

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

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