Firstly I have problem with caffeine: Caffeine doesn't work on Ubuntu 17.10
I didn't bind it with python. BTW, running ubuntu under Xorg didn't help.
Secondly, I received strange error when was trying to test python program. I ran
python3 programname.py test
and receive
File "sampletest.py", line 1, in <module>
import unittest
File "/usr/lib/python3.6/unittest/__init__.py", line 59, in <module>
from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
File "/usr/lib/python3.6/unittest/case.py", line 6, in <module>
import logging
File "/usr/lib/python3.6/logging/__init__.py", line 28, in <module>
from string import Template
ImportError: cannot import name 'Template'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in <module>
from urllib.request import urlopen
File "/usr/lib/python3.6/urllib/request.py", line 88, in <module>
import http.client
File "/usr/lib/python3.6/http/client.py", line 71, in <module>
import email.parser
File "/usr/lib/python3.6/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.6/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/usr/lib/python3.6/email/_policybase.py", line 7, in <module>
from email import header
File "/usr/lib/python3.6/email/header.py", line 16, in <module>
import email.quoprimime
File "/usr/lib/python3.6/email/quoprimime.py", line 44, in <module>
from string import ascii_letters, digits, hexdigits
ImportError: cannot import name 'ascii_letters'
Then I received error after running alacarte: How can I sort Xfce's whisker menu list alphabetically?
BTW, I receive the similar error when run menulibre:
/usr/lib/python3/dist-packages/menulibre/MenuEditor.py:28: PyGIWarning: GMenu was imported without specifying a version first. Use gi.require_version('GMenu', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import GdkPixbuf, Gio, GLib, GMenu, Gtk
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/menulibre/MenulibreApplication.py", line 1717, in do_activate
self.win = MenulibreWindow(self)
File "/usr/lib/python3/dist-packages/menulibre/MenulibreApplication.py", line 207, in __init__
self.configure_application_treeview(builder)
File "/usr/lib/python3/dist-packages/menulibre/MenulibreApplication.py", line 462, in configure_application_treeview
self.treeview = MenulibreTreeview.Treeview(self, builder)
File "/usr/lib/python3/dist-packages/menulibre/MenulibreTreeview.py", line 43, in __init__
self._configure_treeview(builder)
File "/usr/lib/python3/dist-packages/menulibre/MenulibreTreeview.py", line 54, in _configure_treeview
treestore = MenuEditor.get_treestore()
File "/usr/lib/python3/dist-packages/menulibre/MenuEditor.py", line 113, in get_treestore
menu = get_menus()[0]
File "/usr/lib/python3/dist-packages/menulibre/MenuEditor.py", line 175, in get_menus
menu = MenuEditor()
File "/usr/lib/python3/dist-packages/menulibre/MenuEditor.py", line 227, in __init__
self.load()
File "/usr/lib/python3/dist-packages/menulibre/MenuEditor.py", line 245, in load
if not self.tree.load_sync():
GLib.Error: g-markup-error-quark: Error on line 1 char 1: Document was empty or contained only whitespace (1)
I'm sure problem in my python interpreter, but I don't know what it can be. Please, help
P.S. I'm new in linux. So, please, explain as simple as possible
P.P.S. I have Ubuntu 17.10