Error importing matlab.engine on VS Code, Python

13 views
Skip to first unread message

Cuong Tran

unread,
May 29, 2024, 4:18:41 PM5/29/24
to JAABA
Hello,

I am using Matlab_R2023a, and I am working on a Python script that can etract the needed trained and predicted data after Matlab has finished running. On a Python 3.11.3, the line 'import matlab.engine' has an orange squiggle, and when trying to run the code, there is an error message like so:
==========================================================
(base) neurostudent@hulb0763607 rat-behavior-classifier % /usr/bin/
python3 /Users/neurostudent/rat-behavior-classifier/JaabaScoreConve
rsion/get_jaaba_predictions.py
True
Traceback (most recent call last):
  File "/Users/neurostudent/rat-behavior-classifier/JaabaScoreConversion/get_jaaba_predictions.py", line 4, in <module>
    import matlab.engine, os
ModuleNotFoundError: No module named 'matlab'
==========================================================
I have attached a screenshot of the error and the unresolvved line of code below.

According to this, I believe the problem might be that This version of Matlab (R2023a) doesn't support my version of Python (3.11.3). Unfortunately, the nearest time I know of where I can afford to get a new license is in more than a month. Hence, I'm writing this email to ask if there might be some other problems that I haven't considered.

I eagerly await your replies.

Sincerely,
Cuong
Screenshot 2024-05-29 at 3.13.04 PM.png
Reply all
Reply to author
Forward
0 new messages