WolframResearch/WolframClientForPython

Port 36154 error, not startup an kernel server

changzeng opened this issue · 6 comments

I'm run:
from wolframclient.evaluation import WolframLanguageSession kernel = '/home/homework/user/mm/Wolfram/Mathematica/bin/wolfram' session = WolframLanguageSession(kernel) sesstion.start()
and get such error. It seems i haven't startup a kernel server. But i'm a new beginner.Please wise author help me.
`Traceback (most recent call last):
File "/home/homework/user/liaochangzeng/anaconda2/envs/python3.6/lib/python3.6/site-packages/wolframclient/evaluation/kernel/kernelsession.py", line 491, in _start
sleep=self._socket_read_sleep_func)
File "/home/homework/user/liaochangzeng/anaconda2/envs/python3.6/lib/python3.6/site-packages/wolframclient/evaluation/kernel/kernelsession.py", line 662, in read_timeout
% (self.uri, time.perf_counter() - start, retry))
wolframclient.evaluation.kernel.kernelsession.SocketException: Read time out. Failed to read any message from socket tcp://127.0.0.1:36154 after 20.0 seconds and 14259 retries.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/homework/user/liaochangzeng/anaconda2/envs/python3.6/lib/python3.6/site-packages/wolframclient/evaluation/kernel/kernelsession.py", line 421, in start
raise e
File "/home/homework/user/liaochangzeng/anaconda2/envs/python3.6/lib/python3.6/site-packages/wolframclient/evaluation/kernel/kernelsession.py", line 414, in start
self._start()
File "/home/homework/user/liaochangzeng/anaconda2/envs/python3.6/lib/python3.6/site-packages/wolframclient/evaluation/kernel/kernelsession.py", line 504, in _start
% self.kernel)
wolframclient.exception.WolframKernelException: Failed to communicate with the kernel /home/homework/user/cuiyinsheng/Wolfram/Mathematica/bin/wolfram. Could not read from ZMQ socket.`

I read the source code and i find when initialize session object, client would create a server and the run cmd is below:
/home/homework/user/cc/Wolfram/Mathematica/bin/wolfram -noprompt -initfile <infile_path> -run ClientLibraryPrivateSlaveKernelPrivateStart["tcp://127.0.0.1:43508", "tcp://127.0.0.1:38827"];

When i run this command in console i got an error.I don't know the meaning of the last parameter.Thanks God, please wise author see this soon and then give me the answer.

First you need to make sure the executable starts properly. Please run the following command in a shell:
/home/homework/user/mm/Wolfram/Mathematica/bin/wolfram

You should witness a prompt ending with: In[1]:=

Yes sure. My program works well. Here is the message you want.
image
My big question is how to create the kernel server. Could you give me the full command. Cause I haven't found any tutorial to do this.
And another question is i'm not clear about this non-colon parameter. so strange.
image
Then i add the colon both begin and end. Another error arise.
image

You are using 11.0.1. You should update to 11.3 and try again.
See the prerequisites: https://wolframresearch.github.io/WolframClientForPython/docpages/install.html#prerequisites

Ok thanks

It works. Thanks a lot.