python with matlab, undefined variable py?

22 ビュー (過去 30 日間)
Natascha D'Amico
Natascha D'Amico 2019 年 3 月 18 日
コメント済み: Natascha D'Amico 2019 年 4 月 9 日
Hy! I am trying to use a python script on matlab. I have a python version 2.7 on 64 bit and matlab 2018b. After selecting the wished pyversion C:---python.exe and selecting the script it works ones.Then I have the error message :undefined py or class..
Can someone please help?
Thanks, Natascha
>> pyversion C:\ProgramData\Anaconda2\pkgs\python-2.7.15-he216670_0\python.exe
>> py.run_test.py
===== testing package: python-2.7.15-he216670_0 =====
running run_test.py
('Python version:', '2.7.15')
('max unicode:', 65535)
('architecture:', ('64bit', 'WindowsPE'))
('sys.version:', '2.7.15 |Anaconda, Inc.| (default, May 1 2018, 18:37:09) [MSC v.1500 64 bit (AMD64)]')
('platform.machine():', 'AMD64')
('DEBUG:', 0)
('TK_VERSION:', '8.5')
('TCL_VERSION:', '8.5')
('OPENSSL_VERSION:', 'OpenSSL 1.0.2o 27 Mar 2018')
('CPython',
'2.7.15',
'',
'',
'default',
'May 1 2018 18:37:09',
'MSC v.1500 64 bit (AMD64)')
===== python-2.7.15-he216670_0 OK =====
Undefined variable "py" or class "py.run_test.py".
>> py.My_first_simple_Python_script.py
My first simple Python script!
Undefined variable "py" or class "py.My_first_simple_Python_script.py".
>> py.My_first_simple_Python_script.py
Undefined variable "py" or class "py.My_first_simple_Python_script.py".
>> py.run_test.py
Undefined variable "py" or class "py.run_test.py".

回答 (1 件)

Cedric
Cedric 2019 年 3 月 18 日
編集済み: Cedric 2019 年 3 月 18 日
and update the post with the outcome of your tests if it doesn't solve the problem.
  1 件のコメント
Natascha D'Amico
Natascha D'Amico 2019 年 4 月 9 日
thank you very much! I realized that I was opening a script but python opens only modules ! (?)

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

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by