Unity Tweak 工具无法从终端或启动器启动

Unity Tweak 工具无法从终端或启动器启动

Unity Tweak Tool 无法从 Dash 启动。我的 Ubuntu 版本是 16.04。如果我尝试从终端运行,则会收到此错误:

Traceback (most recent call last):
  File "/usr/bin/unity-tweak-tool", line 33, in <module>
    import UnityTweakTool
  File "/usr/lib/python3/dist-packages/UnityTweakTool/__init__.py", line 38, in <module>
    import logging
  File "/usr/lib/python3.5/logging/__init__.py", line 28, in <module>
    from string import Template
ImportError: No module named 'string'
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.5/urllib/request.py", line 88, in <module>
    import http.client
  File "/usr/lib/python3.5/http/client.py", line 71, in <module>
    import email.parser
  File "/usr/lib/python3.5/email/parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "/usr/lib/python3.5/email/feedparser.py", line 27, in <module>
    from email import message
  File "/usr/lib/python3.5/email/message.py", line 16, in <module>
    from email import utils
  File "/usr/lib/python3.5/email/utils.py", line 40, in <module>
    from email.charset import Charset
  File "/usr/lib/python3.5/email/charset.py", line 15, in <module>
    import email.quoprimime
  File "/usr/lib/python3.5/email/quoprimime.py", line 44, in <module>
    from string import ascii_letters, digits, hexdigits
ImportError: No module named 'string'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/unity-tweak-tool", line 33, in <module>
    import UnityTweakTool
  File "/usr/lib/python3/dist-packages/UnityTweakTool/__init__.py", line 38, in <module>
    import logging
  File "/usr/lib/python3.5/logging/__init__.py", line 28, in <module>
    from string import Template
ImportError: No module named 'string'

答案1

将 string.py 文件添加到 python3.5 目录解决了我的问题。不知何故它从那里丢失了。

相关内容