Error Installing MATLAB engine API for Python

172 Ansichten (letzte 30 Tage)
Ashleen Hayes
Ashleen Hayes am 13 Feb. 2017
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 Kommentare
Aatman Mantri
Aatman Mantri am 31 Mär. 2018
The same thing happened to me. Solution: Right click on Command Prompt and Run as Administrator. Problem solved!
wallflower
wallflower am 2 Jan. 2021
Thank you Aatman !

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Bo Li
Bo Li am 13 Feb. 2017
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 Kommentare
Kourosh Zare
Kourosh Zare am 31 Dez. 2021
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
James li
James li am 6 Aug. 2022
Wow! it works

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Jed Frey
Jed Frey am 24 Okt. 2017
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 Kommentare
Ajai Singh
Ajai Singh am 28 Apr. 2022
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.
Abdulaziz
Abdulaziz am 29 Aug. 2022
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

Melden Sie sich an, um zu kommentieren.


Moe Lwin Nang Swe Zin
Moe Lwin Nang Swe Zin am 23 Sep. 2023
Bearbeitet: Moe Lwin Nang Swe Zin am 23 Sep. 2023
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?

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by