필터 지우기
필터 지우기

Matlab Engine for Python Installation Error

조회 수: 73 (최근 30일)
Sangaman Senthil
Sangaman Senthil 2020년 8월 9일
댓글: Nathyane 2023년 9월 10일
Hey there! I am trying to install the Matlab engine for python so I can run Matlab functions in my Visual Studio software. I have tried installing it even while running as an administrator. I am using windows and the image below was the error in the command promt:
Please help! I have been trying for days to see why and I am not able to find a solution :(
  댓글 수: 2
William Retnaraj
William Retnaraj 2021년 2월 20일
Same issue here..
Rebecca Ward
Rebecca Ward 2021년 3월 10일
I'm having the same issue and have tried the approach given in the answer below but get the same as above

댓글을 달려면 로그인하십시오.

답변 (2개)

Gouri Chennuru
Gouri Chennuru 2020년 8월 12일
Hi Sangaman,
As a workaround,
On Windows, you may need to run the command prompt as administrator,in order to write to the protected folders even if you have administrator access. so that you will get rid of the error.
Follow these steps in order to Install MATLAB Engine API for Python.
Step 1: Search for Command Prompt from the start and right click on it, select "Run as administrator".
Step 2: Execute these commands in the command prompt opened, to start the MATLAB engine within a Python session,
cd "matlabroot\extern\engines\python"
python setup.py install
Step 3: Open MATLAB Command Prompt and execute
cd (fullfile(matlabroot,'extern','engines','python'))
system('python setup.py install')
Step 4: Now you can start Python, import the module, and start the MATLAB engine,
import matlab.engine
eng = matlab.engine.start_matlab()
Hope this Helps!
  댓글 수: 2
Muhammad Akif Qadeer
Muhammad Akif Qadeer 2022년 12월 19일
Step 3 doesn't work if I'm using anaconda.
Nathyane
Nathyane 2023년 9월 10일
Step 2 doesn't work for me.

댓글을 달려면 로그인하십시오.


Kieran Smith
Kieran Smith 2022년 9월 12일
Hello, I had this issue for a long time and tried all that you have tried.
What solved it for me was installing in a non-default folder. I built it in the default folder but installed non-default as per the instructions here.
To choose an install folder, I just copied the address where my 'pip install's usually go, but so long as its a folder you have access too I think it should work.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by