7

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 :)

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

3 Answers 3

10

pip install pyxdg works for me.

0

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.

0

Or you might have tried to run import xdg then reference xdg.BaseDirectory, which gives the error: AttributeError: module 'xdg' has no attribute 'BaseDirectory'.

Work around: import xdg, xdg.BaseDirectory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .