Simone
Simone

Reputation: 615

Installing TreeTagger on Windows with Cygewin to use with Python

I want to use TreeTagger for PoS Tagging in German. I used it several years back and remember that the installation was not trivial back then. The installation has not become easier :-/

Now on a new machine I use this tutorial as guideline. I use Windows 10 professional, 64 Bit. Here are the installation steps I have done so far:

  1. Download below five files from the website and put them in one directory.

2) Extract first four files with 7Zip to have *tar* or *par* files and put them in the same directory

3) Create a folder TreeTagger and copy files from step 2 in this folder

4) Run Cygewin as an administrator

5) Change the directory to file locations, i.e. ```cd C:/TreeTagger```

6) Run *install-tagger.sh* file with ```sh install-tagger.sh```

--> It says that the tagging script, the German parameter and chunking files were installed. It also says that the path variables were modified in the tagging scripts.

Also, it says You might want to add /cygdrive/c/TreeTagger/cmd and /cygdrive/c/TreeTagger/bin to the PATH variable so that you do not need to specify the full path to run the tagging scripts

7) When I test the installation with echo 'Das ist ein Test.' | cmd/tagger-chunker-german I get the following error messages:

cmd/tagger-chunker-german: line 16: perl: command not found
cmd/tagger-chunker-german: line 17: /cygdrive/c/TreeTagger/bin/tree-tagger: No such file or directory
cmd/tagger-chunker-german: line 18: /cygdrive/c/TreeTagger/cmd/filter-chunker-output-german.perl: cannot execute: required file not found
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 18: /cygdrive/c/TreeTagger/cmd/utf8-tokenize.perl: cannot execute: required file not found
cmd/tagger-chunker-german: line 19: /cygdrive/c/TreeTagger/bin/tree-tagger: No such file or directory
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 20: perl: command not found
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 22: /cygdrive/c/TreeTagger/bin/tree-tagger: No such file or directory


  1. When I check the bin folder the required files are not there. So maybe I shouldn't use the PC-Linux installation file as suggested. I try again with the ARM64 installation file and delete the files in the TreeTagger folder before I repeat steps 1 to 6.

--> Again it tells me that everything was installed properly. When I test it I get the following error messages

cmd/tagger-chunker-german: line 16: perl: command not found
cmd/tagger-chunker-german: line 17: /cygdrive/c/TreeTagger/bin/tree-tagger: cannot execute binary file: Exec format error
cmd/tagger-chunker-german: line 18: /cygdrive/c/TreeTagger/cmd/filter-chunker-output-german.perl: cannot execute: required file not found
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 18: /cygdrive/c/TreeTagger/cmd/utf8-tokenize.perl: cannot execute: required file not found
cmd/tagger-chunker-german: line 19: /cygdrive/c/TreeTagger/bin/tree-tagger: cannot execute binary file: Exec format error
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 20: perl: command not found
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 22: /cygdrive/c/TreeTagger/bin/tree-tagger: cannot execute binary file: Exec format error

Maybe it did something funny during the extraction. So I repeat steps 2 to 6 but with only unzipping the tree-tagger-ARM64 file. It runs through successfully. No error message in Cygwin. When I test the installation I get again error messages:

$ echo 'Das ist ein Test.' | cmd/tagger-chunker-german
cmd/tagger-chunker-german: line 16: perl: command not found
cmd/tagger-chunker-german: line 17: /cygdrive/c/TreeTagger/bin/tree-tagger: cannot execute binary file: Exec format error
cmd/tagger-chunker-german: line 18: /cygdrive/c/TreeTagger/cmd/filter-chunker-output-german.perl: cannot execute: required file not found
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 18: /cygdrive/c/TreeTagger/cmd/utf8-tokenize.perl: cannot execute: required file not found
cmd/tagger-chunker-german: line 19: /cygdrive/c/TreeTagger/bin/tree-tagger: cannot execute binary file: Exec format error
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 20: perl: command not found
/cygdrive/c/TreeTagger/cmd/tree-tagger-german: line 22: /cygdrive/c/TreeTagger/bin/tree-tagger: cannot execute binary file: Exec format error

Funny thing, the file filter-chunker-output-german is present in the cmd folder. When I try the command echo 'Das ist ein Test.' | cmd/tree-tagger-german it says that the files utf8-tokenize.perl is not there but I can see it.

Last but not least, it did not let me add PATH variables /cygdrive/c/TreeTagger/cmd or /cygdrive/c/TreeTagger/bin. Adding the PATH variable C:/TreeTagger/cmd and C:/TreeTagger/bin hasn't resolved the issue.

So the big question is, how to install TreeTagger?
Any help is appreciated. In the end I like to use TreeTagger with the Python Wrapper.

Looking at previous posts I couldn't figure out a solution. This post was useful but installs the files directly from the server. This post wants to use TreeTaggers standalone GUI. This post wants to install it directly from Python but I read somewhere that this is not ideal for security reasons. This post has a permission error with TreeTagger.

Upvotes: 0

Views: 59

Answers (0)

Related Questions