Skip to content
This repository

Import error using Python 2.7 and dateutil2.0 No module named _thread #816

Closed
dartdog opened this Issue September 22, 2011 · 3 comments

2 participants

Tom Brander Min RK
Tom Brander

Error on notebook
When using pylab option
occurs on new notebook open
Do I need to revert to 1.5 for dateutil??

tom@tom-Satellite-A105:~/ipython$ python2.7 ipython.py notebook --pylab=inline
[IPythonNotebookApp] Using existing profile dir: u'/home/tom/.ipython/profile_default'
[IPythonNotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888
WARNING:root:404 GET /static/mathjax/MathJax.js?config=TeX-AMS_HTML (127.0.0.1) 0.53ms
[IPythonNotebookApp] Kernel started: 8b00eb5d-9b5f-43ca-add5-a585bdf823fe
[IPythonNotebookApp] Connecting to: tcp://127.0.0.1:33937
[IPythonNotebookApp] Connecting to: tcp://127.0.0.1:33031
[IPythonNotebookApp] Connecting to: tcp://127.0.0.1:52402
[IPKernelApp] To connect another client to this kernel, use:

[IPKernelApp] --existing --shell=33937 --iopub=33031 --stdin=45832 --hb=52402

ImportError Traceback (most recent call last)
/home/tom/ipython/ in ()

/home/tom/ipython/IPython/zmq/ipkernel.pyc in main()
695 """Run an IPKernel as an application"""
696 app = IPKernelApp.instance()
--> 697 app.initialize()
698 app.start()
699

/home/tom/ipython/IPython/zmq/ipkernel.pyc in initialize(self=, argv=None)
628 )
629 def initialize(self, argv=None):
--> 630 super(IPKernelApp, self).initialize(argv)
631 self.init_shell()
632 self.init_extensions()

/home/tom/ipython/IPython/zmq/kernelapp.pyc in initialize(self=, argv=None)
214 self.init_sockets()
215 self.init_io()
--> 216 self.init_kernel()
217
218 def start(self):

/home/tom/ipython/IPython/zmq/ipkernel.pyc in init_kernel(self=)
652 if kernel_factory is None:
653 raise ValueError('GUI is not supported: %r' % gui)
--> 654 pylabtools.activate_matplotlib(backend)
655
656 kernel = kernel_factory(config=self.config, session=self.session,

/home/tom/ipython/IPython/lib/pylabtools.pyc in activate_matplotlib(backend='module://IPython.zmq.pylab.backend_inline')
222 # This must be imported last in the matplotlib series, after
223 # backend/interactivity choices have been made
--> 224 import matplotlib.pylab as pylab
225
226 # XXX For now leave this commented out, but depending on discussions with

/usr/local/lib/python2.7/dist-packages/matplotlib-1.0.1-py2.7-linux-i686.egg/matplotlib/pylab.py in ()
218 silent_list, iterable, dedent
219
--> 220 from matplotlib import mpl # pulls in most modules
global matplotlib = undefined
global mpl = undefined
221
222 from matplotlib.dates import date2num, num2date,\

/usr/local/lib/python2.7/dist-packages/matplotlib-1.0.1-py2.7-linux-i686.egg/matplotlib/mpl.py in ()
2 from matplotlib import axis
----> 3 from matplotlib import axes
global matplotlib = undefined
global axes = undefined
4 from matplotlib import cbook
5 from matplotlib import collections
6 from matplotlib import colors

/usr/local/lib/python2.7/dist-packages/matplotlib-1.0.1-py2.7-linux-i686.egg/matplotlib/axes.py in ()
17 import matplotlib.colors as mcolors
18 import matplotlib.contour as mcontour
---> 19 import matplotlib.dates as mdates
global matplotlib.dates = undefined
global mdates = undefined
20 from matplotlib import docstring
21 import matplotlib.font_manager as font_manager

/usr/local/lib/python2.7/dist-packages/matplotlib-1.0.1-py2.7-linux-i686.egg/matplotlib/dates.py in ()
117 import matplotlib.ticker as ticker
118
--> 119 from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \
global dateutil.rrule = undefined
global rrule = undefined
global MO = undefined
global TU = undefined
global WE = undefined
global TH = undefined
global FR = undefined
global SA = undefined
global SU = undefined
global YEARLY = undefined
global MONTHLY = undefined
global WEEKLY = undefined
global DAILY = undefined
global HOURLY = undefined
global MINUTELY = undefined
global SECONDLY = undefined
120 MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY
121 from dateutil.relativedelta import relativedelta

/usr/local/lib/python2.7/dist-packages/python_dateutil-2.0-py2.7.egg/dateutil/rrule.py in ()
11 import datetime
12 import calendar
---> 13 import _thread
global _thread = undefined
14 import sys
15

ImportError: No module named _thread

Min RK
Owner

dateutil 2.0 is for Python >= 3.0 only.

From the dateutil homepage:

If you need dateutil for Python 2.X, please continue using the 1.X series.

Min RK minrk closed this September 22, 2011
Tom Brander

Yup,, found it.. dunno why the default easy_install install gave me 2.0.. Which I took... Sorry.

Min RK
Owner

yeah, that's a problem. PyPI only lists 1.5, but setuptools traverses to the home page and/or download page, where it finds 2.0.

They need to fix their listing, to prevent setuptools from finding 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.