Error Installing MATLAB engine API for Python

I am trying to install the MATLAB engine for Python on my computer and when I write
python setup.py install
I get the following error:
error: could not create 'build': Access is denied
The same error also occurs when I try 'builddir'
I also have administrator access on my computer so I am confused as to why I am being denied.
Any help would be greatly appreciated!

댓글 수: 2

The same thing happened to me. Solution: Right click on Command Prompt and Run as Administrator. Problem solved!
Thank you Aatman !

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

 채택된 답변

Bo Li
Bo Li 2017년 2월 13일

15 개 추천

On Windows, you may need to run the prompt as administrator in order to write to protected folders even if you have administrator access.
Try to search "cmd" on Start and right click on it, select "Run as administrator" to see how it works.

댓글 수: 8

raym
raym 2018년 1월 21일

Great! Solved my problems.

what about Mac??
It worked. Thank you!
Yopu
Yopu 2021년 4월 21일
It doesn't work for me on 2 different PCs, whatever I try. I run the cmd as administrator, i try to set the folder attributes manually (remove the -r attribute), i still always get:
error: could not create 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\matlab': Access is denied
any ideas?
I am having the same issue as Yopu if anyone has ideas that would be great, tried changing permissions from properties but still doesn't work
I'm also having the same issue, Running as Administrator yet still getting Access Denied.
Dear all,
If this problem is still exist.
Please, just dubble check that the full access is enbale for the following folders:
MATLAB:
C:\Program Files\MATLAB\R2021b\extern\engines\python
PYTHON
C:\Program Files\Python39\Lib\site-packages\
Then, using this command to install the API engine for Python by windows shell (cmd).
python setup.py install
Hope it would be useful :)
BR
Kourosh
Wow! it works

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

추가 답변 (3개)

Jed Frey
Jed Frey 2017년 10월 24일

16 개 추천

A better solution, especially if you don't have Admin access to the machine, is to specify the build directory:
python setup.py build -b C:\Temp install

댓글 수: 2

Hello Jed,
I am trying to run a matlab script from my jupyter notebook script on my schools server where i do not have admin rights. And i do get the same error when ever i try to run
python setup.py install
error: could not create 'build': Access is denied
Can you please list all the steps needed to solve this problem.
Thank you.
You can use the following:
Please change <<username>> to your username on the machine
python setup.py build --build-base="C:\Users\<<USERNAME>>\Documents\MATLAB\pythonengine-build" install

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

Moe Lwin Nang Swe Zin
Moe Lwin Nang Swe Zin 2023년 9월 23일
편집: Moe Lwin Nang Swe Zin 2023년 9월 23일

0 개 추천

I'm facing the same error when I tried to install in matlab command window. when installing in cmd run as administrator is fine. does anyone know how to fix that error?
cmd: Installed c:\users\appdata\local\programs\python\python37\lib\site-packages\matlabengineforpython-r2020a-py3.7.egg
Processing dependencies for matlabengineforpython===R2020a
Finished processing dependencies for matlabengineforpython===R2020a
in matlab: error: [WinError 5] Access is denied: 'dist\\matlabengineforpython.egg-info'
if it's installed by cmd, why am I getting "ModuleNotFoundError: No module named 'matlab'" in jupyter?
Carlos Alfaro
Carlos Alfaro 2024년 7월 29일

0 개 추천

I tried the same , runninng it as administrator, and I have the following output, why is this happening?
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/matlab
copying dist/matlab/__init__.py -> build/lib/matlab
creating build/lib/matlab/engine
copying dist/matlab/engine/basefuture.py -> build/lib/matlab/engine
copying dist/matlab/engine/engineerror.py -> build/lib/matlab/engine
copying dist/matlab/engine/enginehelper.py -> build/lib/matlab/engine
copying dist/matlab/engine/enginesession.py -> build/lib/matlab/engine
copying dist/matlab/engine/fevalfuture.py -> build/lib/matlab/engine
copying dist/matlab/engine/futureresult.py -> build/lib/matlab/engine
copying dist/matlab/engine/matlabengine.py -> build/lib/matlab/engine
copying dist/matlab/engine/matlabfuture.py -> build/lib/matlab/engine
copying dist/matlab/engine/__init__.py -> build/lib/matlab/engine
error: The installation of MATLAB is corrupted. Please reinstall MATLAB or contact Technical Support for assistance.

댓글 수: 1

I am receaving the same output. Did you find the solution ?

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

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

질문:

2017년 2월 13일

댓글:

2024년 8월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by