python-dateutil

PIP Installation doesn't work (six, numpy and python-dateutil requirements)

杀马特。学长 韩版系。学妹 提交于 2019-12-02 03:45:11
I'm a quite new to Python and want to install the Pillow package on Mac for Python 3.5. I use the pip install pillow command and get this error: Jaspers-MBP:~ jasperherrmann$ pip install pillow Collecting pillow Using cached Pillow-5.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl prompt-toolkit 1.0.15 has requirement six>=1.9.0, but you'll have six 1.4.1 which is incompatible. pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1 which is incompatible. html5lib 1.0.1 has requirement six>=1.9, but you'll have

PIP Installation doesn't work (six, numpy and python-dateutil requirements)

ε祈祈猫儿з 提交于 2019-12-02 02:04:38
问题 I'm a quite new to Python and want to install the Pillow package on Mac for Python 3.5. I use the pip install pillow command and get this error: Jaspers-MBP:~ jasperherrmann$ pip install pillow Collecting pillow Using cached Pillow-5.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl prompt-toolkit 1.0.15 has requirement six>=1.9.0, but you'll have six 1.4.1 which is incompatible. pandas 0.22.0 has requirement numpy>=1.9.0, but you

Converting ASP.Net JSON Date into Python datetime [duplicate]

做~自己de王妃 提交于 2019-12-01 22:11:21
This question already has an answer here: Date conversion .NET JSON to ISO 4 answers I am getting a response from the rest is an time format like ScheduleDate = "\/Date(1374811200000-0400)\/" StartTime = "\/Date(-2208931200000-0500)\/" How could I convert the above time to format like "2012-01-01T10:30:00-05:00" This is what I came up with, but neither of your example inputs matched up to your example output so I'm not sure whether there's a timezone offset error here or not. #!/usr/bin/env python import datetime def parse_date(datestring): timepart = datestring.split('(')[1].split(')')[0]

Converting ASP.Net JSON Date into Python datetime [duplicate]

白昼怎懂夜的黑 提交于 2019-12-01 21:56:02
问题 This question already has answers here : Date conversion .NET JSON to ISO (4 answers) Closed 6 years ago . I am getting a response from the rest is an time format like ScheduleDate = "\/Date(1374811200000-0400)\/" StartTime = "\/Date(-2208931200000-0500)\/" How could I convert the above time to format like "2012-01-01T10:30:00-05:00" 回答1: This is what I came up with, but neither of your example inputs matched up to your example output so I'm not sure whether there's a timezone offset error

Python - Getting the date format [duplicate]

落花浮王杯 提交于 2019-12-01 09:38:42
This question already has an answer here: How to determine appropriate strftime format from a date string? 3 answers I'm getting a date as a string, then I'm parsing it to datetime object. Is there any way to check what's is the date format of the object? Let's say that this is the object that I'm creating: modified_date = parser.parse("2015-09-01T12:34:15.601+03:00") How can i print or get the exact date format of this object, i need this in order to verify that it's in the correct format, so I'll be able to to make a diff of today's date and the given date. I had a look in the source code

Using dateutil.parser to parse a date in another language

一世执手 提交于 2019-12-01 04:05:28
Dateutil is a great tool for parsing dates in string format. for example from dateutil.parser import parse parse("Tue, 01 Oct 2013 14:26:00 -0300") returns datetime.datetime(2013, 10, 1, 14, 26, tzinfo=tzoffset(None, -10800)) however, parse("Ter, 01 Out 2013 14:26:00 -0300") # In portuguese yields this error: ValueError: unknown string format Does anybody know how to make dateutil aware of the locale? alexwlchan As far as I can see, dateutil is not locale aware (yet!). I can think of three alternative suggestions: The day and month names are hardcoded in dateutil.parser (as part of the

How to install the Six module in Python2.7

时光怂恿深爱的人放手 提交于 2019-12-01 03:17:32
I am using Python 2.7 and trying to use dateutil as follows: from dateutil import parser as _date_parser However, I get the following error: Traceback (most recent call last): File "<pyshell#17>", line 1, in <module> from dateutil import parser as _date_parser File "C:\Python27\Lib\dateutil\parser.py", line 24, in <module> from six import text_type, binary_type, integer_types ImportError: No module named six Could you please let me know what is the six module for and how to get it installed in a Windows 7 machine? You need to install this https://pypi.python.org/pypi/six If you still don't

Using dateutil.parser to parse a date in another language

会有一股神秘感。 提交于 2019-12-01 02:20:52
问题 Dateutil is a great tool for parsing dates in string format. for example from dateutil.parser import parse parse("Tue, 01 Oct 2013 14:26:00 -0300") returns datetime.datetime(2013, 10, 1, 14, 26, tzinfo=tzoffset(None, -10800)) however, parse("Ter, 01 Out 2013 14:26:00 -0300") # In portuguese yields this error: ValueError: unknown string format Does anybody know how to make dateutil aware of the locale? 回答1: As far as I can see, dateutil is not locale aware (yet!). I can think of three

Parsing a date in python without using a default

佐手、 提交于 2019-11-30 22:39:51
问题 I'm using python's dateutil.parser tool to parse some dates I'm getting from a third party feed. It allows specifying a default date, which itself defaults to today, for filling in missing elements of the parsed date. While this is in general helpful, there is no sane default for my use case, and I would prefer to treat partial dates as if I had not gotten a date at all (since it almost always means I got garbled data). I've written the following work around: from dateutil import parser

Python dateutil.parser throws “ValueError: day is out of range for month”

此生再无相见时 提交于 2019-11-30 19:14:29
I have a the following code that runs fine with input format like {Year}/{Month} except when it comes to 1994/02 Here is the sample code >>> import dateutil.parser as dtp >>> dtp.parse('1994/01') datetime.datetime(1994, 1, 29, 0, 0) >>> dtp.parse('1994/03') datetime.datetime(1994, 3, 29, 0, 0) >>> dtp.parse('1994/02') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/antony/.virtualenvs/comp-invest/lib/python2.7/site-packages/dateutil/parser.py", line 720, in parse return DEFAULTPARSER.parse(timestr, **kwargs) File "/Users/antony/.virtualenvs/comp-invest/lib