Group Abstract Group Abstract

Message Boards Message Boards

Fix "SyntaxErr: 'yield' inside async ..." importing wolframclient in Idle?

POSTED BY: Rich Gabrielson
13 Replies
Posted 6 years ago

Okay and Hello Again,

Thank you for this clarification. I thought I could get the .py install for pip3 of wolframclient to work for any machine that reacts to python3.5.x.

Seth

POSTED BY: Seth N

In terms of platform support, I would expect the product to run on most x86 Linux distributions and Raspbian on the Raspberry Pi (where it is available as a deb package), not on any other ARM devices for now.

POSTED BY: Ilian Gachevski
Posted 6 years ago
POSTED BY: Seth N

I think the problem is that it is looking for the default installation location on general Linux systems, which is somewhere under /usr/local/Wolfram, but is different on the Raspberry Pi.

The appropriate path can be specified manually, e.g. by setting an environment variable like

export WOLFRAM_INSTALLATION_DIRECTORY=/opt/Wolfram/WolframEngine/12.0

POSTED BY: Ilian Gachevski
POSTED BY: Rich Gabrielson

Indeed, Python 3.6 accepts the yield statement that 3.5 chokes on. However, in the constructor for WolframLanguageSession this error occurs:

Python 3.6.8 (default, May 27 2019, 11:48:37) 
[GCC 6.3.0 20170516] 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 "<pyshell#3>", line 1, in <module>
    session = WolframLanguageSession()
  File "/usr/local/lib/python3.6/site-packages/wolframclient/evaluation/kernel/localsession.py", line 121, in __init__
    **kwargs)
  File "/usr/local/lib/python3.6/site-packages/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.
>>> 

The error occurs because the function find_default_kernel_path() returns nothing. I used make altinstall as the final step in building the client, to install it in /usr/local/lib -- could that be the problem?

POSTED BY: Rich Gabrielson

The message SyntaxError: 'yield' inside async function seems to indicate that at least Python 3.6 is required (even though the Wolfram Client Library for Python documentation says 3.5)

POSTED BY: Ilian Gachevski
Posted 6 years ago

Hello Sir,

Thank you for this clarification. Now, I understand. Maybe it is time to update the GitHub and Wiki?

Seth

P.S. Anyway, now I know. Python 3.6 is needed I guess. Off to check it out. Will the Wolfram language work on any Debian Distro (Stretch) or do I have to have Raspbian? I am asking b/c I could not seem to make it

POSTED BY: Seth N
Posted 6 years ago

Hello Sir,

Thank you for this clarification. Now, I understand. Maybe it is time to update the GitHub and Wiki?

Seth

P.S. Anyway, now I know. Python 3.6 is needed I guess. Off to check it out. Hey sir, can I use the Wolfram Language on any Debian Distro or do I have to have the Raspbian OS?

POSTED BY: Seth N
Posted 6 years ago

Hello Sir,

Thank you for this clarification. Now, I understand. Maybe it is time to update the GitHub and Wiki?

Seth

P.S. Anyway, now I know. Python 3.6 is needed I guess. Off to check it out. Hey sir, can I use the Wolfram Language on any Debian Distro or do I have to have the Raspbian OS?

POSTED BY: Seth N
Posted 6 years ago

Hello,

I think the Mathematica IDE is the desktop environment. Anyway, I did follow up on the software error in:

SyntaxError: 'yield' inside async function

I found that the "yield" keyword is for a long list of instructions that only needs to be read once but it does not read from the "function body." See here: https://pythontips.com/2013/09/29/the-python-yield-keyword-explained/.

Seth

P.S. As you typed earlier, it might be over my pay grade too. All in all, it may be adventurous to handle that software to see if it is Python3 or just a plain, old keyword in the software for the WolframClient. Either way, if you reply, I will look into it further.

POSTED BY: Seth N
Posted 6 years ago

Hello,

That is the pip3 install wolframclient installation but you still need the cloud or desktop to perform the additions section. I am pretty sure.

I am currently trying to make this work w/ the BBB but I am getting the exact same error message.

Seth

P.S. I know this software is supposed to work but you might need the Cloud or Desktop software to make this work.

POSTED BY: Seth N
POSTED BY: Rich Gabrielson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard