Jump to content

EDICT Problem Can't Install


Recommended Posts

Started using the VNR program for the 1st time and went into the Preferences/Dictionaries to install "EDICT Japanese English dictionary but when i click install a window comes up called getedict.py and closes after a few seconds and it does not install the EDICT and when i look inside the EDICT folder its empty. Could someone help me out and tell me what i need to do to fix this problem ?

Link to comment
Share on other sites

Hi, I've ran into the same problem (it seems that the script can't extract edict properly), but managed to workaround it. It's not pretty  but i am too lazy to find a proper solution:

1. edit Library\Frameworks\Sakura\py\scripts\getedict.py (make a backup first)

2. change line 56 (DO mind that lines are indented with spaces and not tabs (which are defult when inserting new lines with notepad++)) to

Quote

    if sknetio.getfile(url, path, flush=False, gzip=False):

3. after this line insert the following line (mind the extra 2 space indent)

Quote

      u_var = raw_input("unzip then enter any text and press enter")

this makes the script wait for us to provide a properly unzipped file

 

4. try installing edict

5. when the script stops with the message: "unzip then enter any text and press enter" browse to \Caches\tmp\

6. there should be a file called edict2u, unzip it with 7zip and place the file named the same to \Caches\tmp\ (overwrite) 

7. enter any text to the script and press enter, it should install it without further problems

edit: it's line 56 (it should look the same but with gzip=True)

Edited by ma-tor
fixed line number
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

This isn't as old a post as I originally thought. I'll continue my conversation here, if you don't mind.

I would get a message saying edict is already downloaded,  but it still wouldn't be installed. After taking your advice, it closes even quicker now. Am I supposed to switch this:

if sknetio.getfile(url, path, flush=False, gzip=True):
      ok = skfileio.filesize(path) > minsize

With this?:

if sknetio.getfile(url, path, flush=False, gzip=False):
      u_var = raw_input("unzip then enter any text and press enter")
      ok = skfileio.filesize(path) > minsize

 

-Edit-

Opened it up and edited it in IDLE and now, I get to the prompt asking me to enter text and press enter, so I hit space and press enter. still not installed. :(

Link to comment
Share on other sites

On 8/15/2016 at 0:36 PM, impulsedolphin said:

Hi I had all your problems but then I used Sublime text editor and then it started working! Hope it helps!

Thanks, its works

On 8/14/2016 at 9:38 PM, laserbeak43 said:

This isn't as old a post as I originally thought. I'll continue my conversation here, if you don't mind.

I would get a message saying edict is already downloaded,  but it still wouldn't be installed. After taking your advice, it closes even quicker now. Am I supposed to switch this:


if sknetio.getfile(url, path, flush=False, gzip=True):
      ok = skfileio.filesize(path) > minsize

With this?:


if sknetio.getfile(url, path, flush=False, gzip=False):
      u_var = raw_input("unzip then enter any text and press enter")
      ok = skfileio.filesize(path) > minsize

 

-Edit-

Opened it up and edited it in IDLE and now, I get to the prompt asking me to enter text and press enter, so I hit space and press enter. still not installed. :(

 

Download dictionary from here, replace the file in the \Caches\tmp\  after you pressed install

ftp://ftp.edrdg.org/pub/Nihongo/00INDEX.html

edict2u.gz  extract that file using 7zip

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...

Someone noticed above that "gzip" should be set to False in line 56. It looks like that the "gzip=True" parameter was supposed to decompress the file before saving it to /tmp, but it didn't. So the whole installation script can be fixed by manually decompressing, and you don't need to download it yourself. Just make sure getedict.py looks like this (the 5 lines starting with "if sknetio" are the changed/added lines):

  with SkProfiler("fetch"):
    # gzip=True to automatically extract gzip
    # flush=false to use more memory to reduce disk access
    if sknetio.getfile(url, path + '.gz', flush=False, gzip=False):
      import gzip, shutil
      with gzip.open(path + '.gz') as f_in, open(path, 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)
      skfileio.removefile(path + '.gz')
      ok = skfileio.filesize(path) > minsize
  if not ok and os.path.exists(path):
    skfileio.removefile(path)

A very similar problem exists for KanjDic, and the same exact code can fix it. In getkanjidic.py:

  with SkProfiler("fetch"):
    # gzip=True to automatically extract gzip
    # flush=false to use more memory to reduce disk access
    if sknetio.getfile(url, path + '.gz', flush=False, gzip=False):
      import gzip, shutil
      with gzip.open(path + '.gz') as f_in, open(path, 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)
      skfileio.removefile(path + '.gz')
      ok = skfileio.filesize(path) > minsize
  if ok:
    os.renames(path, targetpath)

I could have fixed sknetio.py instead to actually work with gzip=True but oh well. I'm pretty sure this is it anyway.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...