I need help in this tutorial, when I run my python code, this error shows and not compile:
Traceback (most recent call last):
File "getmagic.py", line 2, in <module>
myMagic = makesqr.initialize()
NameError: name 'makesqr' is not defined

4 件のコメント

Flavio Antonio Rodrigues Junior
Flavio Antonio Rodrigues Junior 2017 年 4 月 28 日
編集済み: Flavio Antonio Rodrigues Junior 2017 年 4 月 28 日
I solved:
Tutorial Create a Python Application with MATLAB Code, it's wrong. In step 5 suggests : In the top field of Application Information, replace Library Name makesqr with MagicSquarePkg, but it's wrong. If you change the Library name whem you run the getmagic.py, The error appears :
Traceback (most recent call last): File "getmagic.py", line 2, in module myMagic = makesqr.initialize() NameError: name 'makesqr' is not defined
so the name of Lybrary Name needs to be the same name of the function on file.m (file dot m).
robert haase
robert haase 2017 年 7 月 13 日
編集済み: robert haase 2017 年 7 月 13 日
I have had the same issue but I still get it after following you hint, however. I will keep trying.
robert haase
robert haase 2017 年 7 月 14 日
I instead focused on getting my actual code to run and it worked fine. I had to used Python 2 instead of 3, however.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Python Package Integration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by