sanskrit-lexicon / COLOGNE

Development of http://www.sanskrit-lexicon.uni-koeln.de/
18 stars 3 forks source link

error loading dictionaries #393

Closed JuliaNikolaeva closed 1 year ago

JuliaNikolaeva commented 2 years ago

на этапе sh generate_dict.sh md ../../md так получается Снимок

drdhaval2785 commented 2 years ago

It seems that you have to instal python.

If you have python installed, and still the error comes, you can try to add the location to python executable in PATH vairable

funderburkjim commented 2 years ago

When you install python in Windows, use https://www.python.org/downloads/

I recall having a problem when installing from the microsoft store.

If you still have an installation error, here is another thing to try: You may need to have python available as 'python3' as well as 'python'. in my '~/,bashrc' configuration file (used by Git Bash), there are two lines:

alias python='winpty python.exe'
alias python3='winpty python.exe'

Try adding these to your .bashrc file, restart gitbash terminal, and try sh generate_dict.sh md ../../md install again.

Let me know if you find this necessary for installation to succeed, So I can add a comment to the readme.txt instructions.

JuliaNikolaeva commented 2 years ago

Python was installed from here https://www.python.org/downloads/

I can't find my file .bashrc. Could you tell us in more detail how to make these changes.

alias python='winpty python.exe'
alias python3='winpty python.exe'

UPD I added these lines to the file .bashrc. Nothing has changed.

funderburkjim commented 2 years ago

For debugging, you can add an 'echo' line to your .bashrc file. such as echo "hello from .bashrc". Close your git bash terminal, then open it up again. You should see that echo message -- if so, that proves gitbash is using that .bashrc.

Now, when you change directories to csl-pywork/v02 and do sh generate_dict.sh md ../../md , do you still get an error? If so, please copy paste all the output from your gitbash terminal into a comment here.

JuliaNikolaeva commented 2 years ago

Yes, the error message is still there Снимок

funderburkjim commented 2 years ago

@JuliaNikolaeva
It seems that GitBash cannot find your python. To confirm this, In the git bash terminal, enter the command 'python --version' What is result?

Similarly, enter command 'python3 --version' What is the result.

Separately, open the Windows 'cmd' terminal and try the same commands. What is result?

Also, what is your version of Windows OS?

JuliaNikolaeva commented 2 years ago

In the git bash terminal, enter the command 'python --version' What is result? Similarly, enter command 'python3 --version' What is the result. 1

Separately, open the Windows 'cmd' terminal and try the same commands. What is result? 2

Also, what is your version of Windows OS? Windows 10 Pro

funderburkjim commented 2 years ago

Most mysterious. Maybe there is some problem in accessing python within a script. Try this: Make a script somewhere 'temp_pyversion.sh':

echo "is python found?"
python --version
echo "is python3 found?"
python3 --version

Then run the script in Git bash terminal: sh temp_pyversion.sh> What is output?

funderburkjim commented 2 years ago

@JuliaNikolaeva Ignore that > in previous comment (2nd line from bottom)

JuliaNikolaeva commented 2 years ago

3

funderburkjim commented 2 years ago

OK. So 'python' is found in the script but not 'python3'.

open new gitbash terminal and try 'which python' ; then do an ls on the directory. Do you find python3.exe in that directory?

Here's my result:

$ which python3
/c/Users/jimfu/AppData/Local/Programs/Python/Python39/python3

jimfu@DESKTOP-6PTUC6R MINGW64 /e/pdfwork/rgorr
$ ls /c/Users/jimfu/AppData/Local/Programs/Python/Python39/
DLLs/        NEWS.txt  libs/         python39.dll*      vcruntime140_1.dll*
Doc/         Scripts/  python.exe*   pythonw.exe*
LICENSE.txt  Tools/    python3.dll*  tcl/
Lib/         include/  python3.exe*  vcruntime140.dll*
JuliaNikolaeva commented 2 years ago

image

funderburkjim commented 2 years ago

Weird that the 'ls' shows nothing. What do you get with 'which python' (instead of 'which python3') ?

JuliaNikolaeva commented 2 years ago

image

funderburkjim commented 2 years ago

So 'python' is in a different spot from 'python3'. I think /d/Users/julia/Appdata/Local/Microsift/WindowsApps/python3 may be a remnant from your first installation of python, and that it may be getting in the way. Can you uninstall it? Also, I don't understand why the 'ls' doesn't show any files. try 'ls -all ...'

I'm going to try a full installation on another computer.

funderburkjim commented 2 years ago

I'll do the work on the other computer in a few hours.

funderburkjim commented 2 years ago

@JuliaNikolaeva Whew! Have got most everything working on new computer. Had to make several adjustments due to a newer version of php in xampp. Please look again at: https://github.com/sanskrit-lexicon/COLOGNE/tree/master/localinstall/xampp/readme.txt.

It has been revised. The Python problem will be resolved by two things:

Please also note there are additional things to install:

Also, once you've done above, also pull new versions of csl-apidev, csl-websanlexicon, csl-pywork. (cd to the directory and do git pull). These will get the php corrections.

Then, you are ready (with fingers crossed!) to try again to install md.

I look forward to see how things turn out now. Thanks for your patience.

gasyoun commented 2 years ago

copy python.exe to python3.exe

Sounds fishy to me.

funderburkjim commented 2 years ago

copy python.exe to python3.exe

I got this solution from a stackoverflow comment, and it worked under Windows.

funderburkjim commented 2 years ago

@gasyoun and @JuliaNikolaeva

The instructions I've been leading you through will result in the installation of a 'development' version of the dictionaries. Significantly, you are installing all the Python code used to regenerate (and perhaps change) any of the dictionarie in the local install.

There is another approach which does not require python at all, but, at the same time, only gives you the displays, but not the development environment. The following instructions describe how to get the 'BLAM' displays. https://www.sanskrit-lexicon.uni-koeln.de/scans/MWScan/2020/web/webtc/download.html

gasyoun commented 2 years ago

There is another approach which does not require python at all, but, at the same time, only gives you the displays, but not the development environment. The following instructions describe how to get the 'BLAM' displays. https://www.sanskrit-lexicon.uni-koeln.de/scans/MWScan/2020/web/webtc/download.html

It would be hard to make a single button, to download all at once, all dictionaries, right?

The instructions I've been leading you through will result in the installation of a 'development' version of the dictionaries.

Thanks, hope @JuliaNikolaeva will test the path and make a video of the steps.

funderburkjim commented 2 years ago

Towards a one-button solution for displays

Assumptions: xampp installed and gitbash available Step 1. Make a directory subdirectory of xampp/htdocs - call it what you wish (just make it different from 'cologne', if you also want to have the full development version. I'll use the directory 'colognedisp' in this comment Step 2. make xampp/htdocs/colognedisp/downloadCologne_one.sh from the following:

# downloadCologne_one.sh
dict=$1
dictlo=$(echo $dict | tr '[:upper:]' '[:lower:]' )
dictup=$(echo $dictlo | tr '[:lower:]' '[:upper:]')
href="https://www.sanskrit-lexicon.uni-koeln.de/scans/${dictup}Scan/2020/downloads/${dictlo}web1.zip"

mkdir $dictlo
cd $dictlo
curl $href -o temp.zip
unzip temp.zip
cd ../

Step 3: In Gitbash terminal, cd to the colognedisp directory Step 4: Install one dictionary using the dictionary code. For example, start with the Macdonell dictionary whose code is 'md'. Run the script with this dictionary code as parameter sh downloadCologne_one.sh md

Step 5: You should now have the basic, etc. displays.
Be sure xampp (Apache) is started. Then direct your browser to 'http://localhost/colognedisp/md/web/'.

Let someone with xampp and gitbash give this a try. If it works as expected, we can then ramp up to create a script that would do sh downloadCologne_one.sh X for all dictionary codes X.

gasyoun commented 2 years ago

If it works as expected, we can then ramp up to create a script that would do sh downloadCologne_one.sh X for all dictionary codes X.

Perfect plan. @JuliaNikolaeva will get there.

JuliaNikolaeva commented 2 years ago

I got this result image

JuliaNikolaeva commented 2 years ago

Towards a one-button solution for displays

Assumptions: xampp installed and gitbash available Step 1. Make a directory subdirectory of xampp/htdocs - call it what you wish (just make it different from 'cologne', if you also want to have the full development version. I'll use the directory 'colognedisp' in this comment Step 2. make xampp/htdocs/colognedisp/downloadCologne_one.sh from the following:

# downloadCologne_one.sh
dict=$1
dictlo=$(echo $dict | tr '[:upper:]' '[:lower:]' )
dictup=$(echo $dictlo | tr '[:lower:]' '[:upper:]')
href="https://www.sanskrit-lexicon.uni-koeln.de/scans/${dictup}Scan/2020/downloads/${dictlo}web1.zip"

mkdir $dictlo
cd $dictlo
curl $href -o temp.zip
unzip temp.zip
cd ../

Step 3: In Gitbash terminal, cd to the colognedisp directory Step 4: Install one dictionary using the dictionary code. For example, start with the Macdonell dictionary whose code is 'md'. Run the script with this dictionary code as parameter sh downloadCologne_one.sh md

Step 5: You should now have the basic, etc. displays. Be sure xampp (Apache) is started. Then direct your browser to 'http://localhost/colognedisp/md/web/'.

Let someone with xampp and gitbash give this a try. If it works as expected, we can then ramp up to create a script that would do sh downloadCologne_one.sh X for all dictionary codes X.

image

funderburkjim commented 2 years ago

This looks good!

Next things to try for md:

When all the above look ok, you could then (in csl-pywork/v02)

JuliaNikolaeva commented 2 years ago
  • Go to url localhost/cologne -- you should get a 'home page'
  • Try accessing the displays for 'md' (B L A M) - they should work
  • Next try the link to 'simple search' image

    • You'll need the '.htaccess' file to be in the cologne directory.
    • Choose dictionary 'md' -- You then should be able to look up words in md.

I don't see the file '.htaccess' image

When all the above look ok, you could then (in csl-pywork/v02)

  • manually generate other dictionaries (sh generate_dict.sh xxx ../../xxx for other dictionary codes xxx OR
  • sh redo_xampp_all.sh to generate all the dictionaries. for example image
funderburkjim commented 2 years ago

Regarding one-button solution

The script requires a parameter for the dictionary code: sh downloadCologne_one.sh md

funderburkjim commented 2 years ago

Regarding the 'homepage' (localhost/cologne/):

The homepage html file has to be created (as /c/xampp/htdocs/cologne/index.html). To create this, use the following (see the readme at https://github.com/sanskrit-lexicon/COLOGNE/tree/master/localinstall/xampp).

cd /c/xampp/htdocs/cologne/csl-homepage
sh update_version.sh
sh redo_xampp.sh
JuliaNikolaeva commented 2 years ago

Thank you so much for your help and patience! Everything is working well now

funderburkjim commented 2 years ago

@JuliaNikolaeva Glad to hear that! Let me know if further issues arise.

Will let you close this issue, if you think there are no more questions for now.

gasyoun commented 2 years ago

@JuliaNikolaeva thanks for takin this ride with our miraculous @funderburkjim Can I ask you to document all the steps taken or even make a video for us, please?

drdhaval2785 commented 2 years ago

From what I see on screen, you may also have missing “zip” program. You can download zip for your operating system. Programs would work more smoothly I guess.

funderburkjim commented 2 years ago

installation of zip

The 'zip' command is needed by Gitbash in 'sh generate_dict.sh md ../../md' to generate the .zip files in /c/xampp/htdocs/cologne/md/downloads/. These files are not used by the displays, unless you want to download them. Thus, the absence of 'zip' is not critical. However, you may want to have zip.

The readme file at https://github.com/sanskrit-lexicon/COLOGNE/tree/master/localinstall/xampp now has instructions for installing 'zip'.

funderburkjim commented 2 years ago

request for proof-reading

@JuliaNikolaeva and @drdhaval2785 Request that you carefully review the 'readme.txt' file mentioned above and make suggestions for improvements as needed.

funderburkjim commented 2 years ago

Why python3 needed

copy python.exe to python3.exe Sounds fishy to me.

One quirky feature is that both 'python' and 'python3' are used in various shell scripts that are invoked by generate_dict.sh Thus, local installations we also need both 'python' and 'python3'.

The scripts are supposed to work both on the Cologne Server as well as in local installations.

On the Cologne server, In a script, 'python --version' yields 2.7.5 while 'python3 --version' yields 3.6.8. Some of our python programs do make use of python version 3, so we need to run them on Cologne server with 'python3'.

Thus, for the scripts to work on local server, we need to have both 'python' and 'python3' . The local install instruction (copy python.exe python3.exe) happens to be one way to get 'python3' on local Windows installation.

JuliaNikolaeva commented 2 years ago

installation of zip

The 'zip' command is needed by Gitbash in 'sh generate_dict.sh md ../../md' to generate the .zip files in /c/xampp/htdocs/cologne/md/downloads/. These files are not used by the displays, unless you want to download them. Thus, the absence of 'zip' is not critical. However, you may want to have zip.

The readme file at https://github.com/sanskrit-lexicon/COLOGNE/tree/master/localinstall/xampp now has instructions for installing 'zip'.

I installed 'zip' as it is written in the readme file. Everything is working fine now. Thank you very much!

funderburkjim commented 2 years ago

@JuliaNikolaeva Thanks for feedback that zip instructions worked for you.

gasyoun commented 2 years ago

zip instructions worked for you.

Should we give a link to them from https://www.sanskrit-lexicon.uni-koeln.de/scans/csldev/csldoc/build/index.html ?