invalid kernel
balintradics opened this issue · 2 comments
Hello, I have just tested the following and on 2 different op. systems (Mac 10.14.4 and Cent OS 7) I have similar issues with python 3.7:
Cent OS:
$ cd wolframclient-1.0.2/
$ pip install .
(no errors...)
$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from wolframclient.evaluation import WolframLanguageSession
>>> from wolframclient.language import wl, wlexpr
>>> session = WolframLanguageSession()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/mnt/test/wolframclient-1.0.2/wolframclient/evaluation/kernel/localsession.py", line 121, in __init__
**kwargs)
File "/mnt/test/wolframclient-1.0.2/wolframclient/evaluation/kernel/kernelcontroller.py", line 132, in __init__
'Invalid kernel value. Expecting a filepath as a string.')
ValueError: Invalid kernel value. Expecting a filepath as a string.
Mac:
$ python
Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 10:30:07)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from wolframclient.evaluation import WolframLanguageSession
>>> from wolframclient.language import wl, wlexpr
>>> session = WolframLanguageSession()
>>> session.evaluate(wlexpr('Range[5]'))
Failed to start.
Traceback (most recent call last):
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/kernelcontroller.py", line 431, in _kernel_start
self.trigger_termination_requested))
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/zmqsocket.py", line 54, in recv_abortable
raise SocketAborted('Socket operation aborted.')
wolframclient.evaluation.kernel.zmqsocket.SocketAborted: Socket operation aborted.
During handling of the above exception, another exception occurred:
```Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/localsession.py", line 259, in evaluate
result = self.evaluate_wrap(expr, **kwargs)
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/localsession.py", line 256, in evaluate_wrap
return self.evaluate_wrap_future(expr, **kwargs).result()
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/localsession.py", line 252, in evaluate_wrap_future
self.ensure_started()
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/localsession.py", line 203, in ensure_started
self.start(block=True, timeout=None)
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/localsession.py", line 157, in start
raise e
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/localsession.py", line 152, in start
future.result(timeout=timeout)
File "/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/kernelcontroller.py", line 517, in run
self._safe_kernel_start()
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/kernelcontroller.py", line 364, in _safe_kernel_start
raise e
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/kernelcontroller.py", line 358, in _safe_kernel_start
self._kernel_start()
File "/anaconda3/lib/python3.7/site-packages/wolframclient/evaluation/kernel/kernelcontroller.py", line 443, in _kernel_start
'Wolfram kernel version is not supported. Please consult library prerequisites.'
wolframclient.exception.WolframKernelException: Wolfram kernel version is not supported. Please consult library prerequisites.
>>>
Thanks for helping,
Balint
Hello @balintradics, the first error (linux) is happening because WolframLanguageSession() is trying to automatically find a wolfram kernel on your machine, try to manually specify the path to the kernel in the first arg WolframLanguageSession("/path/to/WolframKernel"), there should be documentation for this.
The second error (Mac) is happening because you are running Mathematica 10 which is not compatible, you need mathematica 11.3+ to use this feature.
https://reference.wolfram.com/language/WolframClientForPython/docpages/install.html#prerequisites
I'm closing this issue, feel free to comment again or re-open if necessary.
Thanks.