【问题标题】:QUEX_PATH issue while using tokenizer使用标记器时的 QUEX_PATH 问题
【发布时间】:2019-10-07 23:37:33
【问题描述】:

我正在尝试安装 trainable-tokenizer。我已经按照自述文件安装了所有依赖项。这是可训练的标记器https://github.com/jirkamarsik/trainable-tokenizer。我已经使用来自 quex.org 的安装程序安装了 quex.deb,这是 trainable-tokenizer 的依赖项。

当我尝试执行 sudo make install 时,出现以下错误

ThinkPad-T430:~/tmp/OpenFST/tokenizer/trainable-tokenizer/src$ sudo make install 
[  6%] Building FeaturesReader with quex
Environment variable QUEX_PATH has not been defined.
error: environment variable 'QUEX_PATH' is not defined.
error: your system is 'posix'.
error: if you are using bash-shell, append the following line
error: to your '~/.bashrc' file:
error:
error: export QUEX_PATH=directory-where-quex-has-been-installed
make[2]: *** [quex_files/trtok_read_features_FeaturesReader] Error 255
make[1]: *** [CMakeFiles/trtok.dir/all] Error 2
make: *** [all] Error 2

但我已经设置了 QUEX_PATH。

ThinkPad-T430:~/tmp/OpenFST/tokenizer/trainable-tokenizer/src$ echo $QUEX_PATH 
/opt/quex/quex-0.65.4/
ThinkPad-T430:~/tmp/OpenFST/tokenizer/trainable-tokenizer/src$ ll /opt/quex/quex-0.65.4/
total 68
drwxrwxr-x 5 root root  4096 May 25 17:42 ./
drwxrwxr-x 3 root root  4096 May 25 17:42 ../
-rw-r--r-- 1 root root   181 Oct 13  2013 COPYRIGHT.txt
drwxr-xr-x 5 root root  4096 May 25 17:42 demo/
-rw-r--r-- 1 root root     0 Feb 26 02:01 __init__.py
-rwxr-xr-x 1 root root 26424 Oct 13  2013 LGPL.txt*
drwxr-xr-x 2 root root  4096 May 25 17:42 manpage/
drwxr-xr-x 6 root root  4096 May 25 18:02 quex/
-rw-r--r-- 1 root root  3098 Oct 13  2013 quex.bat
-rwxrwxr-x 1 root root  2649 Feb 26 02:01 quex-exe.py*
-rw-r--r-- 1 root root  4074 Oct 13  2013 README
-rw-rw-r-- 1 root root   118 Mar 22 15:22 unit_test_results.txt

我还在.bashrc 中添加了export QUEX_PATH=/opt/quex/quex-0.65.4/

ThinkPad-T430:~/tmp/OpenFST/tokenizer/trainable-tokenizer/src$ vim ~/.bashrc
ThinkPad-T430:~/tmp/OpenFST/tokenizer/trainable-tokenizer/src$ echo $QUEX_PATH 
/opt/quex/quex-0.65.4/
ThinkPad-T430:~/tmp/OpenFST/tokenizer/trainable-tokenizer/src$ sudo make install
[  6%] Building FeaturesReader with quex
Environment variable QUEX_PATH has not been defined.
error: environment variable 'QUEX_PATH' is not defined.
error: your system is 'posix'.

但我仍然遇到同样的错误。

【问题讨论】:

    标签: c++ makefile tokenize make-install quex


    【解决方案1】:

    我使用-I 标志解决了这个问题。我必须使用quex -I

    【讨论】:

      【解决方案2】:

      我猜真正的问题是你的 python 是 python 3.0+ 而不是 Quex 所需的 python 2.7。

      诚然,错误信息并没有直接说明这一点。

      【讨论】:

      • 这是我会接受的提示,可能会再试一次。我会尝试使用不同版本的python。我对这个建议投了赞成票。将检查它是否有效。
      • 不。它没有帮助。
      • 在 Makefile 中,就在调用 'quex' 之前。可以添加“echo $QUEX_PATH”命令。我希望像“quex -i ...”这样的东西并将其更改为“echo $QUEX_PATH; quex -i ...”。然后,复制粘贴结果。顺便说一句,你联系过 Jiri 吗?这可能是他的 Makefile 的问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-14
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多