Win7: Fixing textext on Inkscape 0.48 解决Tek Text问题

本文提供了一种解决Inkscape 0.48上TextExt插件因Python模块过时导致的问题的方法。通过更新缺失的Python包及修改TextExt的源代码,可以成功使插件恢复正常运行。

I encounter one problem today. My textext didn’t work on Inkscape 0.48, I get the error

1textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead import os, sys, tempfile, traceback, glob, re, md5, copy
2Traceback (most recent call last): File "textext.py", line 306, in <module>
3raise RuntimeError("Neither pygtk nor Tkinter is available!")
4RuntimeError: Neither pygtk nor Tkinter is available!

The error is due to a module depreciated on the python version used on Inkscape, and that Textext uses. However, it was pretty easy to solve.

  • First you need to download and the python packages that are missing, thanks to David Gleich whom packed everything together, avoiding us the trouble of download them and put the pieces together.
  • Unzip them C:/Program Files/Inkscape/python/Lib/site-packages

Then you need to update your textext files,  thanks to Pascal Schulthess for the solution.

  • Go to C:/Program Files/Inkscape/share/extensions, and open textext.py file
  • Now replace

54import inkex
55import os, sys, tempfile, traceback, glob, re, md5, copy
56from lxml import etree

and replace it for

54import inkex
55import os, sys, tempfile, traceback, glob, re, copy
56import hashlib
57from lxml import etree

  • And replace this
    868def __init__(self, document):
    869    PdfConverterBase.__init__(self, document)
    870    self.hash = None
    871def convert(self, *a, **kw):
    872    # compute hash for generating unique ids for sub-elements
    873    self.hash = md5.new('%s%s' % (a, kw)).hexdigest()[:8]
    874    return PdfConverterBase.convert(self, *a, **kw)
    875def pdf_to_svg(self):
    876    exec_command(['pdf2svg', self.tmp('pdf'), self.tmp('svg'), '1'])
  • for

    868def __init__(self, document):
    869    PdfConverterBase.__init__(self, document)
    870    self.hash = None
    871    USE_GTK = False
    872def convert(self, *a, **kw):
    873    # compute hash for generating unique ids for sub-elements
    874    m = hashlib.md5()
    875    m.update('%s%s' % (a, kw))
    876    self.hash = m.hexdigest()[:8]
    877    return PdfConverterBase.convert(self, *a, **kw)
    878def pdf_to_svg(self):
    879    exec_command(['pdf2svg', self.tmp('pdf'), self.tmp('svg'), '1'])
Restart Inkscape  and the Tex Text works.
attention: you should pay attentions to the space or indent when you replace. or you will have a indent wrong in line871 when you run it.
but just using my this method of my passage is enough to solve the problem.
it works well!
<think>好的,我现在要解决用户提到的“retry after fixing problem by hand”问题。首先,我需要理解这个错误的具体情境。通常,这种提示出现在系统或软件检测到某个问题,需要手动修复后才能重试。那么,用户可能在使用某个软件、工具或服务时遇到了错误,系统提示他们先手动修复问题,然后再重试操作。 接下来,我需要分析可能的原因。可能的场景包括依赖项缺失、配置错误、权限问题、资源冲突或数据损坏等。比如,在开发中,编译项目时缺少某个库,系统提示安装后重试;或者权限不足导致无法写入文件,需要修改权限后再试。 然后,用户需要逐步排查问题。首先,检查错误信息的具体内容,确定问题所在。例如,错误日志可能指出某个文件无法访问,或者某个服务未启动。接着,根据错误信息进行手动修复,如安装缺失的包,调整配置文件,修改权限,重启服务等。完成修复后,再次尝试操作,观察是否解决。 另外,常见场景可能包括版本兼容性问题。例如,软件依赖的某个组件版本过旧,需要升级。或者网络问题导致下载失败,需要检查网络连接。权限问题方面,可能需要使用sudo或管理员权限运行命令,或者修改文件/目录的读写权限。 对于数据库操作,事务冲突或锁表可能导致需要手动干预,比如终止占用资源的事务后再重试。在系统资源方面,内存或磁盘空间不足也可能触发此类错误,需释放资源后重试。 用户可能还需要参考文档或社区,寻找类似问题解决方案。如果手动修复后仍存在问题,可能需要更深入的分析,如检查日志文件,使用调试工具,或联系技术支持。 总结来说,解决步骤包括:理解错误信息,定位问题根源,手动修复(安装、配置、权限、资源等),验证修复,最后重试操作。需要具体问题具体分析,但遵循系统提示并仔细检查相关配置和资源是关键。</think>遇到“retry after fixing problem by hand”(手动修复后重试)的提示时,通常表示系统检测到某个问题无法自动解决,需要人工干预。以下是分步解决思路: --- ### **1. 理解错误上下文** - **触发场景**:常见于软件安装、编译、服务启动、数据库操作、资源访问等场景。 - **关键线索**:错误日志中会明确说明具体问题(如文件缺失、权限不足、依赖冲突等)。 --- ### **2. 定位问题根源** #### **检查错误日志** - 找到完整的错误信息(控制台输出、日志文件)。 - 示例错误类型: ``` Permission denied: /var/log/app.log Package 'libxyz' not found Port 8080 is already in use ``` --- ### **3. 手动修复常见问题** #### **场景1:依赖缺失/版本冲突** - **问题表现**:缺少库、包或工具(如 `libxxx not found`)。 - **修复方法**: ```bash # 安装缺失依赖(以Ubuntu为例) sudo apt-get install libxxx-dev # 或通过包管理器(如Python的pip) pip install package-name==1.2.3 ``` #### **场景2:权限不足** - **问题表现**:`Permission denied`、`Access is denied`。 - **修复方法**: ```bash # 修改文件/目录权限 chmod 755 /path/to/file chown user:group /path/to/directory # 或以管理员身份运行 sudo command ``` #### **场景3:端口/资源冲突** - **问题表现**:`Address already in use`、`Resource busy`。 - **修复方法**: ```bash # 查找占用端口的进程并终止 lsof -i :8080 kill -9 <PID> ``` #### **场景4:配置文件错误** - **问题表现**:`Invalid configuration`、`Syntax error`。 - **修复方法**: - 检查配置文件路径(如 `/etc/app/config.yaml`)。 - 验证语法格式(如YAML/JSON缩进、符号转义)。 #### **场景5:数据损坏** - **问题表现**:`Corrupted database`、`Checksum failed`。 - **修复方法**: - 恢复备份数据。 - 使用修复工具(如 `fsck` 修复文件系统)。 --- ### **4. 验证修复结果** - 重新运行操作,观察是否仍报错。 - 若问题解决,检查是否遗漏其他关联错误(如多个依赖项缺失)。 --- ### **5. 高级排查工具** - **日志分析**:`journalctl`(Linux)、Event Viewer(Windows)。 - **调试模式**:运行命令时添加 `--verbose` 或 `--debug` 参数。 - **网络诊断**:`curl -v`、`telnet`、`tcpdump`。 --- ### **6. 典型示例** 假设错误为 `Failed to start service: Port 3000 is occupied`: 1. **查找占用进程**: ```bash sudo lsof -i :3000 # 输出结果示例:node (PID 1234) ``` 2. **终止进程**: ```bash kill -9 1234 ``` 3. **重试服务启动**: ```bash systemctl start my-service ``` --- ### **总结** - 核心步骤:**定位错误 → 手动修复 → 验证重试**。 - 若仍无法解决,需结合具体场景进一步分析(如系统兼容性、内核参数调整等)。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值