掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 2815|回复: 18

[求助] 求教大神: PYGLOSSARY 的使用问题

[复制链接]
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

    发表于 2021-8-24 12:05:02 | 显示全部楼层 |阅读模式
    各位大神好! 我在尝试使用PYGLOSSARY 制作mac词典出现了问题?5 E6 [! k- K6 k4 |
    & q- _1 Z: }2 ~
    我的环境
    5 [+ A) C# g  r
    1. macOS Big Sur  11.5.2
      1 q4 s9 `6 h5 Q& l2 b" A
    2. python  3.9.6
    复制代码

    + g5 m0 X+ J9 l
    ( k0 ?$ l/ b/ y3 ?
    % z4 u5 _0 S  m% p+ ]7 }; A目前成功安装. P3 t5 |1 ]: K: g% i) ~
    - Q* E0 r$ W* k: |: M7 ^
    1. beautifulsoup 4 4.9.3
      + [, V; F4 ?' n
    2. html5lib       1.15 |8 v# D# _+ H- |$ H
    3. lxml           4.6.3, M/ Q0 ^# L2 v
    4. python-lzo     1.12
    复制代码
    # P4 U5 @# W- s

    # B9 N  P& x) D3 `0 T: c0 u ( W" B7 n) s4 F5 k* l

    9 ^) z& a4 x. ?) T* W' h Command Line Tools for Xcode 12.5.1  安装成功  z# V( R4 Y" c+ V2 ^
    Auxiliary Tools 内 Dictionary Development Kit 我复制到 /Applications/Utilities
    1 C" o5 q  {6 v# ~

    & [. `/ }  B) |( O' y9 \$ c& k( N% g/ w' @. K7 |
    pyglossary 我下载的最新版 4.1.0rc2  ,解压到 /Users/liliane/Software0 b- Y3 C* ~: i. ^4 `; j

    # l6 E8 \1 M3 M
    % a: N9 B) \9 i" b4 q7 w
    * Q* j: Y8 y# l7 _& r0 x然后执行命令' z/ ?' O- ?% B( l+ q( d2 R, N
    1. cd ~/Downloads/OALD4
      2 t4 t& r5 o4 r" m& [
    2. python ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict OALD4_Ex.mdx OALD4_Ex.xml
    复制代码
    9 D7 ~! [* r: _! u/ C0 x1 S
    $ ^! k( o6 M6 h9 ?. N
    ; r1 g! ?  H/ S4 }- p

    + q, H/ x; Q! E! {8 q: ]$ h给出报错! T% U/ }+ W5 s6 m  {
    1. [ERROR] Invalid option name resPath for format OctopusMdict
    复制代码
    ) V9 Y: }3 K+ R2 J, ?9 A; t
    - A( @" |  \, ^; ]3 A8 I/ l* R5 q
    # Z0 @5 r; _3 `: x5 J; t" h& g

    9 m, }9 M5 t7 K5 U; ~! `- E; J- x- ~% W2 Z( g1 I" E7 ^% J7 K
    运行- T# `4 O; o* q  P$ B
    1. python ~/Software/pyglossary/pyglossary.pyw --help
    复制代码

    , h& o4 d+ n( v- s+ |4 u7 g# L- f6 `7 {
    1. PyGlossary is a tool for working with dictionary databases (glossaries)
      % n( ]% y( i- p3 z0 X; m, g
    2. Basic Usage:# X1 L. }( P) l# A: ^" W& B
    3.     PyGI (Gtk3) Interface:7 I# k2 H4 {5 L. Z
    4.         To open PyGlossary window:
      ! [% V* L9 l/ ?' I2 Y
    5.             pyglossary
      " @, `6 v9 l. z9 i6 i
    6.         PyGI is the default interface (so you never need to use "--ui=gtk" or --gtk option)
      0 n$ r, |6 q! N( D' X1 q1 \0 O
    7.         If PyGI was not found (not installed), then PyGlossary will fallback to Tkinter interface.3 O# N$ p# V4 f1 U+ \( a" I
    8.     Tkinter Interface:
      - |# \$ i( T( h8 H" h
    9.         To open PyGlossary window:
      2 V  F9 V0 \+ `, v3 S
    10.             pyglossary --tk$ x7 N6 X5 I/ r0 I  u6 V1 J
    11.         Or
      9 f+ N, n9 l. C( n. S: X$ P! H
    12.             pyglossary --ui=tk" b% p, {1 u# \/ [
    13.         Usually good for Windows and Mac OS X
      ; q* o0 d# `# f
    14.     Command-line interface:
      : c/ ?; }: e1 Z! j- ?+ W
    15.         To show this help:
      3 ^: N# Y0 m+ z+ J4 e8 D* L7 u
    16.             pyglossary --help
      ) N$ Q: _+ D2 c% Q" f) [" ]
    17.         To show program version:& `8 g9 q" o) y3 v9 n
    18.             pyglossary --version
      ( }# {  C3 V3 h  ?. ~
    19.         To Convert:# Z6 @9 O- R# k/ w5 w
    20.             pyglossary INPUT_FILE OUTPUT_FILE6 F6 G! d& A6 n
    21.         To Reverse:! f$ R( J. s1 a* @$ ^7 t
    22.             pyglossary INPUT_FILE OUTPUT_FILE.txt --reverse) `- T) \& ~8 g, N; l
    23.         Input and output formats will be detected from extensions if possible.' O1 s5 P2 R: }/ \% t5 z; O
    24.         If not, you need to specify input or output format, for example:( D3 |' E) ]- K* x
    25.             pyglossary test.utf8 test.ifo --read-format=tabfile  h3 `4 X' \$ f6 z) l" N
    26.             pyglossary test.utf8 test.ifo --read-format tabfile
      4 _/ c, Q! T# ?( w
    27.             pyglossary test.ifo test.utf8 --write-format=tabfile
      $ {- w3 u( x( r8 c7 \, U( a2 C
    28.             pyglossary test.ifo test.utf8 --write-format tabfile9 }  l6 p* ]1 ^* c" o/ l. }
    29. 5 \  o8 X9 V- D" @9 x& ^* w7 K
    30.     Interactive command-line interface:% V+ m4 Y' D% m) T
    31.         Minimal command:3 `8 U7 u; p5 e, ?
    32.             pyglossary --cmd
      4 ^* {3 |1 e! ~8 [  j6 C
    33.         Or
      # N& b4 z" Z1 W
    34.             pyglossary --ui=cmd, ~$ y8 B* s) G. S
    35.         Additionally you can pass any flag to act to act as default9 q* u9 [5 @& n2 h2 B
    36.   }) P% W- o& {* Z! Z- Y" m

    37. ! t8 [0 B9 M9 I) T2 k- q' j+ |
    38. General Options:; ]4 }1 A/ D: q5 o3 Z8 h$ N$ \- H
    39.     Verbosity:: x! [3 j' y( M& K
    40.         -v0 or '--verbosity 0' for critical errors only
      2 Z9 y) C8 r4 g7 r" u& b
    41.         -v1 or '--verbosity 1' for errors only
      + d% R$ j% a- P/ N% W6 {
    42.         -v2 or '--verbosity 2' for errors and warnings1 i0 n% S) \( H" u. }
    43.         -v3 or '--verbosity 3' for errors, warnings and info4 h. K; v- j9 ~% Y& k$ J
    44.         -v4 or '--verbosity 4' for debug mode
      : [4 U0 f" P% D' s- T9 k1 Y* T- C
    45.         -v5 or '--verbosity 5' for trace mode# ^& q3 n5 k* I, D
    46.     Appearance:8 W; k/ V) [; B
    47.         --no-progress-bar and --no-color, useful for scripts1 F- }1 ~8 I" V& \4 \* M2 S

    48. 0 A! y6 h8 `3 d6 T; a
    49. Full Convert Usage:! c- C! _8 P% _7 Z
    50.     pyglossary INPUT_FILE OUTPUT_FILE [-vN] [--read-format=FORMAT] [--write-format=FORMAT]
      6 c3 R, Z  B  T' ]3 a4 a
    51.         [--sort|--no-sort] [--direct|--indirect] [--no-alts] [--sort-cache-size=2000] [--utf8-check|--no-utf8-check]
      . z/ X& [6 M$ C- E: @& e
    52.         [--lower|--no-lower] [--read-options=READ_OPTIONS] [--write-options=WRITE_OPTIONS]& A; F+ N3 y! g6 {6 F
    53. $ R/ t2 F; I. G, q

    54. # k3 t" r/ {4 T0 I1 j* R- Q
    55. Command line arguments and options (and arguments for options) is parsed with GNU getopt method
      ! h0 H& c, ?* e0 |' E
    56. You can also just type extension of output file instead of full path, if you want to create with the same input1 _1 N2 a) A4 s
    57. file name with another extension. For example:3 z5 P; ?5 ]! y+ k& u
    58.     pyglossary mydic.ifo txt
      ! z9 G0 V, F; T- T3 `$ g
    59. instead of:
      6 _. h4 O3 u; z7 R. m8 S2 y8 h
    60.     pyglossary mydic.ifo mydic.txt; _1 B7 U; g" C! F0 g1 {
    61. Compressing with gz, bz2 and zip is supported, just append these extension to the file name, for example:
        W) A) v% W8 I, F7 ?& @% s
    62.     pyglossary mydic.ifo mydic.txt.gz
      , _. ?! x# j+ V- z! e
    63. or
      ' ]- \/ c5 O$ M+ g# o/ C
    64.     pyglossary mydic.ifo txt.gz) j; N! P% N; d' H7 e  L, h1 o
    65. And if the input file has these extensions (gz, bz2, zip), it will be extracted before loading; R2 G& p% M6 V
    复制代码
    - I. Q/ n1 F# E' S

    % K! D6 |- z$ D6 K
    0 z$ R! R$ l9 Z2 n) ^6 z6 T/ M9 a0 Y* h  Y7 W

    / O) k  u3 J+ gApplications/Utilities/Dictionary Development Kit  下面* E+ a! F: W+ o, @7 I
    1. bin
      " I% ?1 [; f, W. G
    2. documents! ]5 b, f* k" K0 F
    3. project_templates
      ( U6 R2 ?! N2 m1 Z8 [
    4. samples
    复制代码

    * q/ N. q' ]( w- }, t
    ) k7 U/ k7 r# I4 ?; [( C
    ; [5 n: |# e6 b0 o4 @! v' y* \至今不知道问题出现在哪里? 麻烦各位了
    % ^" \0 s* t+ B! Z4 f/ _: O
    9 A! W1 F7 j( Y/ S5 W! I* N/ i3 g
    * t) |" {! w1 }# c1 d3 N, }# u  ~; t) C
    9 [' D1 j2 ~# O/ l; P; q
  • TA的每日心情
    开心
    2023-3-29 19:50
  • 签到天数: 136 天

    [LV.7]常住居民III

    发表于 2021-8-24 13:10:56 | 显示全部楼层
    python3 pyglossary.pyw -u cmd 模式下试试
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-24 13:26:10 | 显示全部楼层
    本帖最后由 漫步云海涧 于 2021-8-24 13:28 编辑 2 ^  X0 |3 H7 G
    ryuka 发表于 2021-8-24 13:10
    ' [- `- v- c) ~, R9 zpython3 pyglossary.pyw -u cmd 模式下试试
    9 Q. W8 S) \* \

    6 f# M- c0 M; ~) x5 a9 }" V我的python 做了符号链接, python 默认版本是 python 3.9.68 H: u; k3 q  V- ]( [

    8 n$ V4 r, m, u0 ~
    9 {( a6 x' ^- ~- J+ _& v4 j: O& @
    1. cd ~/Downloads/OALD4: i* j/ v$ ^: T- Y& x  e
    2. python3 ~/Software/pyglossary/pyglossary.pyw -u cmd
    复制代码
    7 \- g1 Q/ ^4 q. }+ e

    + D$ B6 B2 c7 v给我返回的信息:
    ( J% G( q  M6 X: |3 h
    1. [CRITICAL] Traceback (most recent call last):# [" |, K5 P( y3 G
    2.   File "/Users/liliane/Software/pyglossary/pyglossary.pyw", line 10, in <module>
      1 q7 W; e1 F, ]
    3.     main()
      ) r! r2 h. s& U! F
    4.   File "/Users/liliane/Software/pyglossary/pyglossary/ui/main.py", line 562, in main) t6 w- }$ ^' W7 p7 c
    5.     from pyglossary.ui.ui_cmd_interactive import UI
      & a/ S6 |* n5 Y7 f0 K' {3 I0 J4 Z
    6.   File "/Users/liliane/Software/pyglossary/pyglossary/ui/ui_cmd_interactive.py", line 44, in <module>
      ) u& v, G. Q. o) g
    7.     from prompt_toolkit import prompt as promptLow
      : @4 n" Y5 n9 a0 w4 x
    8. ModuleNotFoundError: No module named 'prompt_toolkit'
    复制代码

    ; c8 |( N) W# Z  ]! t) A: R
  • TA的每日心情
    开心
    2023-3-29 19:50
  • 签到天数: 136 天

    [LV.7]常住居民III

    发表于 2021-8-24 13:30:31 | 显示全部楼层
    漫步云海涧 发表于 2021-8-24 13:26
    8 \, x1 o* r& m, p: W我的python 做了符号链接, python 默认版本是 python 3.9.6

    - l% F, o8 U% N  ppip3 install prompt_toolkit
  • TA的每日心情
    慵懒
    2021-9-1 08:46
  • 签到天数: 61 天

    [LV.6]常住居民II

    发表于 2021-8-24 13:30:40 | 显示全部楼层
    本帖最后由 zhangchaont 于 2021-8-24 13:35 编辑
    - u) G' |+ z9 ?
    + Y. c  f. [; m1 f" I9 V7 `2 M要先安装这些依赖包:. T) H2 [- I7 a( m" \0 |
    brew install python3 pygobject3 gtk+3
    + V  ~, `, y0 O! T* h4 ~$ d; k+ [. e# {: M5 i: `
    ---1 g# k2 v5 v( J. N& V+ J' ?

    , S, e) `3 R3 d$ x+ n, j我当时用的是brew install pyglossary1 J8 [3 w1 x" B: z
    然后运行pyglossary --gtk
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-24 13:55:14 | 显示全部楼层
    zhangchaont 发表于 2021-8-24 13:30
    & X* t  |) e2 v6 |, z5 l6 W3 V) y要先安装这些依赖包:
    3 _& c8 _  h# u5 U: ebrew install python3 pygobject3 gtk+3
    9 E6 ]- k& H3 n2 O
    python 3 我已经安装了, 所以就执行了
    ! K7 L) Z. y. P+ E& H0 g9 ^( g: B1 ?8 f* w2 y
    brew install pygobject3 gtk+3  
    . K, N- X0 @, kpip3 install prompt_toolkit
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-24 13:58:41 | 显示全部楼层
    ryuka 发表于 2021-8-24 13:106 o1 D  z% L5 @, @7 B, X2 b0 [
    python3 pyglossary.pyw -u cmd 模式下试试
    1. python3 ~/Software/pyglossary/pyglossary.pyw -u cmd
      / C6 @% Y4 u6 w6 v* |
    2. > Input file:
      % |  O, x( y6 S  q% l
    复制代码

    - Z; F$ Q: d1 h& [( l, w/ l; p' |" K6 D- P
    " > Input file: " 相当于命令行么?  是在这里输入  python ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict OALD4_Ex.mdx OALD4_Ex.xml   吗?
  • TA的每日心情
    慵懒
    2021-9-1 08:46
  • 签到天数: 61 天

    [LV.6]常住居民II

    发表于 2021-8-24 13:59:45 | 显示全部楼层
    漫步云海涧 发表于 2021-8-24 13:557 W  \9 `* h2 d( L3 s; m& N: M3 |- _
    python 3 我已经安装了, 所以就执行了 # k$ T6 V7 R# M% R/ k0 X& g' k
    . ]1 O. o( |6 b9 e" A( {
    brew install pygobject3 gtk+3  

    $ @; X0 X$ `" @" L  U$ [" R我上面写错了,是用pip3安装pyglossary.' Z* e/ Q* e( t3 `3 y# u
    pip3 install pyglossary
  • TA的每日心情
    开心
    2023-3-29 19:50
  • 签到天数: 136 天

    [LV.7]常住居民III

    发表于 2021-8-24 14:02:18 | 显示全部楼层
    漫步云海涧 发表于 2021-8-24 13:58
    ( r6 |  ~/ D8 _( W9 x1 j! J" > Input file: " 相当于命令行么?  是在这里输入  python ~/Software/pyglossary/pyglossary.pyw -- ...

    ( q$ L+ n) W+ s! A6 n, M源文件路径,如/Volumes/HIKVISION/词典/英语/学习词典/Longman Dictionary Of Contemporary English 6th EnEn/LongmanDictionaryOfContemporaryEnglish6thEnEn.mdx
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-24 14:07:06 | 显示全部楼层
    zhangchaont 发表于 2021-8-24 13:59
    & `7 \+ ^- v4 ~! e+ b7 [- L9 E我上面写错了,是用pip3安装pyglossary.2 N$ H7 D1 }/ I& O4 R0 v( N
    pip3 install pyglossary

    - T$ {/ c4 j6 n# P+ ^$ fpyglossary 我是下载下来,解压缩到 ~/Software  目录下。 还需要用brew再安装 应该不需要了吧
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-24 14:11:48 | 显示全部楼层
    ryuka 发表于 2021-8-24 14:02
    ! L) ~9 b6 F& b- c: C, g源文件路径,如/Volumes/HIKVISION/词典/英语/学习词典/Longman Dictionary Of Contemporary English 6th ...

    ! F, G* g2 g6 |4 A% J) |非常感谢,目前已经成功,等待转换中......  w( f: j6 s$ e/ \# J+ D7 x$ Z
    这是我的操作' f* J7 q' y1 d, S$ {$ z

    1 f9 y7 O- a# Q+ j2 [- ?- Q( S
    1. ❯ python3 ~/Software/pyglossary/pyglossary.pyw -u cmd4 J* n9 y8 z! |8 o
    2. > Input file: /Users/liliane/Downloads/OALD4/OALD4_Ex.mdx
      $ `* `5 N# J. n; h& y
    3. > Output file: /Users/liliane/Downloads/OALD4/OALD4_Ex.xml
      8 M9 ]4 b5 R9 y, S; h% b
    4. > Output format: AppleDict
        h7 V7 d; o/ }% h* K* k
    5. > Select action (ENTER to convert):
    复制代码

    0 K& H$ i0 D1 H3 ^: x! W/ }! }4 e7 [7 u1 C2 p/ n9 C
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-24 14:14:56 | 显示全部楼层
    本帖最后由 漫步云海涧 于 2021-8-24 14:39 编辑
    : i2 x0 u( Y6 o+ H4 [3 N: U: J* a* s, k6 p9 x
    目前转换成功 ,谢谢各位大神的帮助
    5 {3 h; e3 S/ I; n9 }  _% i$ @: q
    1. > Select action (ENTER to convert):; {- ]# l, h! a  e$ j2 U& Y
    2. [INFO] Found 1 mdd files with 433 entries
      2 i, J6 L" w/ }9 }3 t
    3. [INFO] extracting links...
      , d6 y; ~( T8 j5 p8 y5 q
    4. [INFO] extracting links done, sizeof(linksDict)=13108082 H% ~0 ^+ e3 w( {% P
    5. [INFO] wordCount = 512083 `: W8 C5 \8 v" D- c
    6. [INFO] Failed to detect sourceLang and targetLang from glossary name '牛津高阶双解(第四版)'
        ?1 P5 `: T$ O+ `6 O2 z- |
    7. . I) b# }9 \" U; `* P& G
    8. [INFO] Writing to AppleDict file '/Users/liliane/Downloads/OALD4/OALD4_Ex.xml'! d/ f+ ~9 _. ?
    9. [INFO] Using Reader class from OctopusMdict plugin for direct conversion without loading into memory2 [+ ?; E0 d5 i7 I, s0 H( e9 D
    10. Converting | |█████████████████████████████████████████████|%100.0 Time: 0:02:56
      7 H8 i" c  E. C- k" B

    11. ; d" f, v, X" {
    12. [INFO] Writing file '/Users/liliane/Downloads/OALD4/OALD4_Ex.xml' done.( M' E3 @4 G4 D  y
    13. [INFO] Running time of convert: 180.8 seconds
      : Q! h  I; ^: ^) F# o

    14. 2 K# L' l- k/ x4 _9 ], G! G
    15. If you want to repeat this conversion later, you can use this command:
      + m" O- M$ M) P; Y% N
    16. pyglossary /Users/liliane/Downloads/OALD4/OALD4_Ex.mdx /Users/liliane/Downloads/OALD4/OALD4_Ex.xml --read-format=OctopusMdict --write-format=AppleDict0 x1 Z. W( D3 a3 Y
    复制代码

    / j- H! A( x' ~' S0 J9 K
    & Z7 n) T8 I5 l
    ; p) Y: F. p% W: _9 x# V% \' Z

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?免费注册

    x
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-27 16:44:10 | 显示全部楼层
    昨天系统出现问题,重新安装了转换词典的环境 又出现报错了
    / T6 H2 t) U% M+ i1 C) a+ m" T2 a
    1. python3 ~/Software/pyglossary/pyglossary.pyw -u cmd
      ( \3 K8 ~  N5 F, G
    2. > Input file: /Users/vivian/Downloads/concise/concise_enhanced.mdx
      0 M7 V! x" Y) c8 |/ O
    3. > Output file: /Users/vivian/Downloads/concise/concise- z* l' D( v( K# e* I
    4. > Output format: AppleDict
      / ^9 l: L+ v& |
    5. > Select action (ENTER to convert):
    复制代码

    ( h" s  m+ N0 A+ m/ s' Z
    6 s* h# v8 \+ g% y/ p+ T输出报错7 s0 ?6 G! u: r' z9 \( V
    1. Try Brutal Force on Encrypted Key Blocks; J# @7 y# B3 R' z# B
    2. unhandled exception:
      # M- Z5 E4 ~# W# I1 F) O# b
    3. Traceback (most recent call last):
      ( K( B: `; x: Y: L* k0 V8 M
    4.   File "/Users/vivian/Software/pyglossary/pyglossary/plugin_lib/readmdict.py", line 104, in __init__
      0 V# X+ `' J* P' n
    5.     self._key_list = self._read_keys()9 I: e( e  W5 T) Y
    6.   File "/Users/vivian/Software/pyglossary/pyglossary/plugin_lib/readmdict.py", line 362, in _read_keys
      ! S4 |' x/ o: W. T. r$ l# X$ C
    7.     key_block_info_list = self._decode_key_block_info(key_block_info)
      ' ^) Y7 u% W% o. X  q, q/ D
    8.   File "/Users/vivian/Software/pyglossary/pyglossary/plugin_lib/readmdict.py", line 148, in _decode_key_block_info4 L9 a: g) x' [8 n" ~3 a  c
    9.     assert(key_block_info_compressed[:4] == b'\x02\x00\x00\x00')
      + l/ |9 J, S# T$ j8 N0 h
    10. AssertionError
      8 n' u  N  P/ V, D
    11. 3 T3 p- v6 f6 U$ O+ f, f0 N4 T
    12. During handling of the above exception, another exception occurred:
      9 Y- D" E- R  f6 s1 g

    13.   p! Y: B5 z$ {. ?  i
    14. Traceback (most recent call last):
      ! o; J( c* {4 K4 A
    15.   File "/Users/vivian/Software/pyglossary/pyglossary/glossary.py", line 854, in read% P$ h- r6 z, b
    16.     reader.open(filename)7 j  B4 z! i* Q4 E
    17.   File "/Users/vivian/Software/pyglossary/pyglossary/plugins/octopus_mdict_new/__init__.py", line 71, in open
      5 t  v% I) b5 J- Z
    18.     self._mdx = MDX(filename, self._encoding, self._substyle)3 p) \2 ]+ g  v0 I! L7 t5 R
    19.   File "/Users/vivian/Software/pyglossary/pyglossary/plugin_lib/readmdict.py", line 516, in __init__
      . U; L- i0 a' M% N: ~
    20.     MDict.__init__(self, fname, encoding, passcode)" n( o% H" [5 V+ R
    21.   File "/Users/vivian/Software/pyglossary/pyglossary/plugin_lib/readmdict.py", line 107, in __init__
      6 t  M  _% f1 l7 G8 X# T4 c
    22.     self._key_list = self._read_keys_brutal()4 C" `9 G: K7 }0 @& ^4 E' ]* A
    23.   File "/Users/vivian/Software/pyglossary/pyglossary/plugin_lib/readmdict.py", line 394, in _read_keys_brutal
      - A3 c3 O1 ^1 Y0 A/ g7 @7 c
    24.     assert key_block_info[:4] == b'\x02\x00\x00\x00'( t* u& p. H  t. t7 E4 A- x
    25. AssertionError) r2 m' u# y( r5 U4 w
    26. 1 H& a) W# A9 d6 H. |3 C# }4 K
    27. 6 n/ |" n7 B: q; H
    28. If you want to repeat this conversion later, you can use this command:0 l' _2 T. [5 y
    29. pyglossary /Users/vivian/Downloads/concise/concise_enhanced.mdx /Users/vivian/Downloads/concise/concise --read-format=OctopusMdict --write-format=AppleDict: Y2 @1 A$ W8 D6 v" @0 B
    30. Press Control + C to exit
      - N7 _% z5 B/ T  h
    31. > Select action (ENTER to convert):
    复制代码

    " T: _2 t; W0 m, D" v) Y: j4 J/ y; V' D; q0 G
    / E8 {8 k! _# i% z, G! f1 x% i
    1. ❯ pip3 list  Q6 B' U7 L' ?' p8 b
    2. Package        Version
        [- }8 L" n: U# e" f( i/ b, ~
    3. -------------- -------
      ( U4 ~! }% Y. F' p5 W; T: S; z6 q
    4. beautifulsoup4 4.9.3
      9 j" ^: q# B) P. k* [- k3 Y0 a' L
    5. html5lib       1.1% N& h, V+ U6 |
    6. lxml           4.6.3
      , ]- X% d4 u% O% h- e: `
    7. pip            21.2.4
      5 Y( {" _: B! d1 q4 F9 E# V; I2 A
    8. prompt-toolkit 3.0.20$ ], ~  Z2 H# i9 H4 m7 o% E
    9. pycairo        1.20.1
      # k9 E! s. \  V5 `3 u& w# Z
    10. PyGObject      3.40.1
      ' k9 s, \3 R2 b3 j# m: E0 y
    11. python-lzo     1.12: ?2 r; L" Q6 F! W$ C
    12. setuptools     57.0.0
      / @8 q0 K2 Q* m8 k) `- s) P: o
    13. six            1.16.0
      - h# C- O0 M' O9 R; t" O. _" J. v
    14. soupsieve      2.2.1
      ) ~. g, f6 r; i9 D9 Q7 ?
    15. wcwidth        0.2.5
      , Q- U* _5 X' f- Y
    16. webencodings   0.5.1+ T' I8 D* r3 U: B
    17. wheel          0.36.2
    复制代码

    # L9 O7 t$ T, o7 i( h/ w3 }: _5 X/ Y

    / g0 p6 E% e; q. dpygobject3  gtk+3 也安装了, 请问各位大神这是什么原因?
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-27 16:46:36 | 显示全部楼层
    ryuka 发表于 2021-8-24 14:021 V& w4 z( D: Q5 n0 C% V2 V- H% R
    源文件路径,如/Volumes/HIKVISION/词典/英语/学习词典/Longman Dictionary Of Contemporary English 6th ...
    8 r6 W' I5 s8 ~( R. |
    还请大神帮个忙 看一下报错信息,麻烦了
  • TA的每日心情
    开心
    2023-3-29 19:50
  • 签到天数: 136 天

    [LV.7]常住居民III

    发表于 2021-8-28 07:38:27 | 显示全部楼层
    换个mdx试试呢
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-28 08:15:03 | 显示全部楼层
    ryuka 发表于 2021-8-28 07:383 Z, ^1 b$ h0 n- b5 C0 A  |
    换个mdx试试呢
    ! U. }( `  M! |2 Q& V

    ; `! i2 [7 q- x4 ~我换了mdx 没有问题可以转成功, 不过中间有部分信息缺失了2 o/ C/ H9 }. M0 g* D* I# Q% B* D

    " i: |; ?' K5 d0 q4 Z
    1. [INFO] Failed to detect sourceLang and targetLang from glossary name 'Shorter_Oxford_English_Dictionary_6th.mdx'
    复制代码
    6 e1 d1 ~6 j' \- @5 Y: f- n

    ' E" \! i) Q: L我转换失败的这部词典是简明增强版,里面只有 mdx 、 css  没有mdd文件
    0 v1 t8 u( c+ {: J" ~% i5 G, a
    9 r- L6 c$ v6 X! u' w' y( W$ K* I是否失败跟这个有关系呢?
  • TA的每日心情
    开心
    2023-3-29 19:50
  • 签到天数: 136 天

    [LV.7]常住居民III

    发表于 2021-8-28 08:33:42 | 显示全部楼层
    我记得那个词典是mdx builder4.0打包的,无法解压
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-28 09:09:41 | 显示全部楼层
    本帖最后由 漫步云海涧 于 2021-8-28 09:10 编辑 % k; C: s0 o3 z
    ryuka 发表于 2021-8-28 07:38" O' c% V. U. i5 I- {( s( A4 V
    换个mdx试试呢
    & ~9 z: K: a8 [, m, p& I

    9 B4 Q9 v9 w7 ?另外我想问一下 ,下面这条命令是哪里有问题 我该怎么写呢?
    8 F" U9 ?" J/ t
    0 k0 l6 F; _! T
    1. python3 ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict Shorter_Oxford_English_Dictionary_6th.mdx SOED6_Dict
    复制代码
    , l- P5 \+ [/ e! N# ?

    0 M. `  I) m9 ~$ l8 ^+ \# ^' g# a
    9 [$ |: x$ @8 q+ Y' _/ l报错
    5 B' ]% q+ {. [% C5 O* I
    1. [ERROR] Invalid option name resPath for format OctopusMdict
    复制代码
    5 s1 S  q1 x: L6 B& J8 t+ [8 m& j

    3 H2 x* u$ A5 f5 ^/ Q1 T! u( o7 i4 C6 h/ s4 D
    ! Y4 o7 T) k3 R: w/ `
    % x2 H7 d0 W7 ^* u% a: X

    - r* n; _1 b2 ]4 u: n; p我现在一直用的是你之前说的 cmd 5 e. R1 X' n! a! L1 Y( M7 ^
    1. python3 ~/Software/pyglossary/pyglossary.pyw -u cmd
    复制代码
  • TA的每日心情
    擦汗
    2021-11-17 09:18
  • 签到天数: 79 天

    [LV.6]常住居民II

     楼主| 发表于 2021-8-28 09:14:39 | 显示全部楼层
    ryuka 发表于 2021-8-28 08:33
    : l6 z0 T3 P9 a, q我记得那个词典是mdx builder4.0打包的,无法解压
    & q: p$ Y% ]8 D' q2 Z7 i6 O
    我去原贴看一下  ,谢谢了
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

    小黑屋|手机版|Archiver|PDAWIKI |网站地图

    GMT+8, 2025-5-21 14:42 , Processed in 0.024839 second(s), 22 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表