I tried to install Screenlets on my system using help from this link (Screenlets not working in Ubuntu 16.04 ( Just Need analogue clock widget)). After following all the given steps I tried to run it using the command screenlets & which returned an import error ImportError: No module named xdg.BaseDirectory. I've attached a screenshot of my terminal for greater clarity. Please help me out to resolve this error.

This is the screenshot of the terminal

Thanks in advance :)

  • Do you have python-xdg and/or python3-xdg installed. Depending on which Python version screenlets uses.
    – Timo
    Jan 15 '17 at 10:45

pip install pyxdg works for me.


Not sure whether your question is still relevant. Even if it isn't, maybe someone else will require this information.

I had the same issue, couldn't find a solution on the internet. Apparently nobody else had this issue before. The solution in my case was within the library path of Python. You can check the library path by running this little Python script:

import sys
print '\n'.join(sys.path)

xdg.BaseDirectory is installed in a subdirectory of /usr/lib/python2.7/dist-packages but due to the path Python will look in /usr/local/lib/python2.7/dist-packages first. If xdg is in the /usr/local/... subdirectory you will get the same sort of error message. (python2.7 is just an example; could be python3.5 or whatever your version of Python is)

Rename all the xdg stuff in /usr/local/lib/python2.7/dist-packages to something else (to be on the safe side) and see whether your applications work again. They did in my case.

Please give some feedback whether it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.