77得票4回答
在OS X上出现的Matplotlib问题(“ImportError:无法导入名称_thread”)

在过去几天中,Matplotlib 在我的 OS X 上停止工作。在尝试导入 matplotlib 时,我遇到了以下错误: At some point in the last few days, Matplotlib stopped working for me on OS X. Here...

56得票2回答
导入错误:matplotlib需要dateutil模块。

我已经在x64位Windows 7上成功安装了python 2.6版本的matplotlib。当我尝试导入matplotlib时,它显示以下错误。我还按照此链接安装了numpy:Installing Numpy on 64bit Windows 7 with Python 2.7.3impor...

55得票3回答
Python3中dateutil.parser的替代方法是什么?

Python 2.x有一个很棒的函数,叫做dateutil.parser,可以将ISO8601格式的日期转换为Python datetime值。但是它在Python 3中已经不存在了。那么替代方案是什么呢?

51得票4回答
Python datetime strptime()和strftime():如何保留时区信息

请看下面的代码: import datetime import pytz fmt = '%Y-%m-%d %H:%M:%S %Z' d = datetime.datetime.now(pytz.timezone("America/New_York")) d_string = d.strf...

51得票11回答
如何在Windows上安装python-dateutil?

我试图将一些日期/时间转换为UTC,我认为在Python中这应该非常简单 - 毕竟它是“电池包”语言,对吧?但是,问题在于Python(2.6)并未包含任何tzinfo类。没问题,快速搜索结果发现python-dateutil 可以完全满足我的需求。 问题是我需要在Windows上安装它。我...

51得票3回答
安装Python dateutil

我试图为我的django tastypie安装python dateutil,但没有成功。 http://labix.org/python-dateutil#head-2f49784d6b27bae60cde1cff6a535663cf87497b 我在c:/python27下载了tar文...

50得票2回答
Python中的dateutil.parser.parse解析月份在前,而不是日期。

我正在使用dateutil.parser.parse来从字符串格式化日期。但现在它把月份和日期搞混了。 我有一个包含05.01.2015的字符串。在dateutil.parser.parse("05.01.2015") 它返回:datetime.datetime(2015, 5, 1, 0,...

47得票1回答
升级Python包dateutil:找不到版本。

我尝试使用pip install dateutil --upgrade将dateutil从2.5.3升级到最新版本2.6.0,但遇到了问题Could not find a version。$ pip install dateutil --upgrade Collecting dateutil ...

45得票8回答
Python 2.7:无法在Windows上使用pip "bash:pip:命令未找到"

我正在尝试安装位于 https://scipy.org/stackspec.html 的 SciPy 栈 [我只能使用2个链接; 尽量明智地使用它们]。 我知道有更简单的方法来完成这个过程,但我认为通过手动操作可以学到很多东西。 我对很多这方面的问题都比较新,所以如果在任何时候听起来无知,请原...

43得票1回答
使用"import dateutil"和"dateutil.parser.parse()"时出现AttributeError,但是使用"from dateutil import parser"则没有问题

我正在使用Python 2.7.3中的 dateutil 模块 进行编程。我想要使用以下代码: import dateutil dateutil.parser.parse("01-02-2013") 但是我遇到了一个错误: AttributeError: 'module' object...