Jump to content
Jakethesnake

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 ?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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. :(

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
On 8/14/2016 at 11: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!

Did the same after trying everything else and this works great

Share this post


Link to post
Share on other sites

Anyone got time to check inside \VNR\Visual Novel Reader\Caches\Dictionaries\EDICT and tell me what the name of the file is?

Is it edict2u? Using that name doesn't work and getedict.py doesn't tell me what the name should be like getkanjidic.py did.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×