3
$\begingroup$

What I am trying to do is to generate an array using Python inside Mathematica but I getting TypeError required field:type_ignores missing Module. Here is the image: screenshot And then I check if the session is available with the 2+2.

$\endgroup$
4
$\begingroup$

You're probably using Python 3.8:

Here's the fix that worked for me, although I still have to call the python from ExternalEvaluate[]:

open C:\Program Files\Wolfram Research\Mathematica\12.0\SystemFiles\Links\WolframClientForPython\wolframclient\utils\externalevaluate.py

Go to line 66

replace exec(compile(ast.Module(expressions), '', 'exec'), current)

with exec(compile(ast.Module(expressions, []), '', 'exec'), current)

Referenced from: https://gist.github.com/Riebart/7622c17237a6ddb2516fd09ea67307ff

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.