TransWikia.com

Python module error using Externalsession

Mathematica Asked on September 29, 2021

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.

One Answer

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 FilesWolfram ResearchMathematica12.0SystemFilesLinksWolframClientForPythonwolframclientutilsexternalevaluate.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

Correct answer by Ioannis Mourginakis on September 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP