python-dateutil

Matplotlib issue on OS X ("ImportError: cannot import name _thread")

Matplotlib issue on OS X ("ImportError: cannot import name _thread") Question: At some point in the last few days, Matplotlib stopped working for me on OS X. Here’s the error I get when trying to import matplotlib: Traceback (most recent call last): File “/my/path/to/script/my_script.py”, line 15, in <module> import matplotlib.pyplot as plt File “/Library/Python/2.7/site-packages/matplotlib/pyplot.py”, line …

Total answers: 4

python 2.7: cannot pip on windows "bash: pip: command not found"

python 2.7: cannot pip on windows "bash: pip: command not found" Question: I am trying to install the SciPy stack located at https://scipy.org/stackspec.html [I am only allowed 2 links; trying to use them wisely]. I realize that there are much easier ways to do this, but I think there is a lot to be learned …

Total answers: 8

AttributeError when using "import dateutil" and "dateutil.parser.parse()" but no problems when using "from dateutil import parser"

AttributeError when using "import dateutil" and "dateutil.parser.parse()" but no problems when using "from dateutil import parser" Question: I was playing with the dateutil module in Python 2.7.3. I simply wanted to use: import dateutil dateutil.parser.parse(“01-02-2013”) But I got an error: AttributeError: ‘module’ object has no attribute ‘parser’ I checked what attributes dateutil does have: print …

Total answers: 1

ImportError: matplotlib requires dateutil

ImportError: matplotlib requires dateutil Question: I have successfully installed matplotlib with python 2.6 on x64 Windows7. When I try to import matplotlib, it shows the following error. I have also installed numpy following this link: Installing Numpy on 64bit Windows 7 with Python 2.7.3 import matplotlib.pyplot as plt Traceback (most recent call last): File “<pyshell#2>”, …

Total answers: 2

Python datetime strptime() and strftime(): how to preserve the timezone information

Python datetime strptime() and strftime(): how to preserve the timezone information Question: See the following code: import datetime import pytz fmt = ‘%Y-%m-%d %H:%M:%S %Z’ d = datetime.datetime.now(pytz.timezone(“America/New_York”)) d_string = d.strftime(fmt) d2 = datetime.datetime.strptime(d_string, fmt) print d_string print d2.strftime(fmt) the output is 2013-02-07 17:42:31 EST 2013-02-07 17:42:31 The timezone information simply got lost in the …

Total answers: 4

Python cannot find dateutil.relativedelta

Python cannot find dateutil.relativedelta Question: I am trying to run a program using paster serve, but I keep getting the error: ImportError: No module named dateutil.relativedelta I am running Python version 2.6.7 and dateutil version 1.5, so it should be installed. Has anyone got any ideas as to why this would happen? I am importing …

Total answers: 4

How to install python-dateutil on Windows?

How to install python-dateutil on Windows? Question: 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 …

Total answers: 11