0

I am using the DriverlessAI(with H2O.ai) and trying to use scorer (which is a Diagnosis model made from DriverlessAI), but an error occurred.

When running run_tcp_client.sh, the error " File "example_client.py", line 5, in from thrift import Thrift ModuleNotFoundError: No module named 'thrift'" has occurred.

In the document(https://www.h2o.ai/wp-content/uploads/2017/09/driverlessai/scoring-package.html) it's written that it is enough to run run_tcp_client.sh after runing run_tcp_server.sh.

What can I do about this?

Mateusz Dymczyk
  • 14,969
  • 10
  • 59
  • 94
H.Doi
  • 1

1 Answers1

0

You need to install Thrift as per the documentation you linked:

The following are required in order to run the scoring package. [..] Apache Thrift (to run the TCP scoring service):

Installing Thrift

Thrift is required to run the scoring service in TCP mode, but it is not required to run the scoring module. The following steps are available on the Thrift documentation site at: https://thrift.apache.org/docs/BuildingFromSource.

$ sudo apt-get install automake bison flex g++ git libevent-dev \
  libssl-dev libtool make pkg-config libboost-all-dev ant
$ wget https://github.com/apache/thrift/archive/0.10.0.tar.gz
$ tar -xvf 0.10.0.tar.gz
$ cd thrift-0.10.0
$ ./bootstrap.sh
$ ./configure
$ make
$ sudo make install

@EDIT:

Please check if you can run (in the folder where you have those scripts) this:

$ source client_env/bin/activate
$ python -c 'from thrift.transport import TSocket'

If you get the same exception then please run:

pip install -r client_requirements.txt

And try running the script again.

Mateusz Dymczyk
  • 14,969
  • 10
  • 59
  • 94
  • Thank you for your advice. And I could not explain in detail, sorry. – H.Doi Nov 02 '17 at 00:54
  • I did installing thrift, and I can run run_tcp_server.sh which used thrift. So, I think python can't done the code "from thrift.transport import TSocket" . – H.Doi Nov 02 '17 at 00:59
  • @H.Doi sorry I'm not following - what is the exact error you're getting after running the example now? – Mateusz Dymczyk Nov 02 '17 at 03:55
  • @ Mateusz Dymczyk Error message is 「File "example_client.py", line 5, in from thrift import Thrift ModuleNotFoundError: No module named 'thrift'」 I explain what I did below. 1. prepared an EC2-instance on AWS (ubunts 16.0.4) 2. install python3.6 (with command shown in "6.1 Prerequisites" in document) 3. Install Thrift (with command shown in "6.1 Prerequisites" in document) 4. run run_tcp_server.sh 5. run run_tcp_client.sh and the above error occured. Sorry to understand "thrift" or "Driverless AI". – H.Doi Nov 02 '17 at 06:34
  • @ Mateusz Dymczyk Sorry and Thank you for your advice. I ran after @EDIT, and I noticed that the cause of the error was the failure to install pip.     After installed pip with command 'curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" ' and 'pip install -r client_requirements.txt' , I can do it. Thank you very mach !! – H.Doi Nov 07 '17 at 08:46
  • @H.Doi no problem, hope you'll be pleased with DAI :-) also please "accept" this answer, so we know that you figured out your issue. – Mateusz Dymczyk Nov 07 '17 at 09:12