ImportError: No module named 'matlab.engine'; 'matlab' is not a package (Windows)

5 ビュー (過去 30 日間)
John Deer
John Deer 2018 年 8 月 31 日
コメント済み: Stephan 2018 年 9 月 3 日
Hello,
i've installed MATLAB Engine API for Python (Windows 7) according to
https://de.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
Matlab-Version: R2018a
Python Version: 3.5.1
Now i'm trying to initialize a connection according to
https://de.mathworks.com/help/matlab/matlab_external/connect-python-to-running-matlab-session.html
What follows is this Error-Message:
ImportError: No module named 'matlab.engine'; 'matlab' is not a package
What works is
import matlab
but not
import matlab.engine
I have two Python installation on the computer and did the above installation for both of them (calling the python.exe from the specific folder, the installation for the python version used was last). Some hints for this problem exist, but only for linux.
Has anybody an idea? Thanks
  6 件のコメント
John Deer
John Deer 2018 年 8 月 31 日
Supplement:
On the PC with the working system, the file
C:\Program Files\Python35\Lib\site-packages\pygments\lexers\matlab.py
exists too.
On both PC's (working and non working) the following files exist:
C:\Program Files\Python35\Lib\site-packages\matlab\engine\matlabengines.py
Stephan
Stephan 2018 年 8 月 31 日
編集済み: Stephan 2018 年 8 月 31 日
Sorry, then i have no idea what you could do to solve this. But it was worth a try. Good luck for solving this. If yo find a solution please post it here.
Best regards
Stephan

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

採用された回答

John Deer
John Deer 2018 年 9 月 3 日
Now i've got the answer to the riddle:
ITOM does have an own matlab-support:
https://itom.bitbucket.io/latest/docs/08_scriptLanguage/pymod-matlab.html
On the corresponding PC, a colleague did already the setup for the ITOM-connection. The other connection is in conflict with this.
  1 件のコメント
Stephan
Stephan 2018 年 9 月 3 日
Thats good to see - will help people in future if they have the same trouble!

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by