User login

Solving a newly installed application not running on Debian when you vaguely recall the app is Python

I'm using Debian Mint but all of this should also apply for Ubuntu and maybe even Mac OS X.

In my case i was installing QTodoTxt but the same debugging, and potentially solution, should apply to any application. They had a .deb package which i used to install it, and i was delighted— I wouldn't have to worry about handling dependencies myself. Indeed, it installed successfully and showed up with a nice icon in my application launcher. And launching it... did nothing.

Running the application from the command line provided some useful feedback:

$ qtodotxt 
Traceback (most recent call last):
  File "/usr/bin/qtodotxt", line 11, in 
    from qtodotxt import app
  File "/usr/share/qtodotxt/bin/../qtodotxt/app.py", line 13, in 
    from qtodotxt.ui.dialogs.taskeditor import TaskEditor
  File "/usr/share/qtodotxt/bin/../qtodotxt/ui/dialogs/taskeditor.py", line 2, in 
    from qtodotxt.ui.dialogs.taskeditor_dialog import TaskEditorDialog
  File "/usr/share/qtodotxt/bin/../qtodotxt/ui/dialogs/taskeditor_dialog.py", line 7, in 
    from dateutil.relativedelta import relativedelta
ImportError: No module named 'dateutil'

However, pip freeze | grep date reported python-dateutil==2.6.1 installed just fine, and for me it was completely useless to follow all the recommendations of uninstalling and reinstalling (apt-get uninstall python-dateutil; apt-get install python-dateutil) and the different ways of installing (easy_install) that the rest of the World Wide Web will tell you to do (this is the only site you can trust). Fortunately I stopped short of installing it from gzipped binary blob as many answers were recommending, because that way lies madness.

Instead, I took a look at the file that started it all, in the usual place for unix system resources binary applications (/usr/bin) but also revealing its path at the top of the stacktrace:

less /usr/bin/qtodotxt

And once i looked at it, the answer was in the first line:

#!/usr/bin/env python3

And now i was close enough to guess at a solution:

sudo apt-get install python3-dateutil

Apparently the Debian package manager doesn't do Python dependencies or doesn't know the difference between Python 2 and Python 3.

Searched words: 
ImportError: No module named 'dateutil' python import not working in /usr/bin app.run

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.