matlab python engine module not recognized
I am having trouble using the matlab python engine. I tried this piece of code from the mathworks website:
import matlab.engine
if __name__ == ‘__main__’:
eng = matlab.engine.start_matlab()
x = 4.0
eng.workspace[‘y’] = x
a = eng.eval(‘sqrt(y)’)
print(a)
pass
But pycharm is giving me an error saying "ModuleNotFoundError: No module named ‘matlab.engine’; ‘matlab’ is not a package". I am using python 3.6 and matlab 2018. I saw that these are the supported versions on website, I saw a similar post about this problem but I can’t even run my program from python command line. I also can’t find teh matlab.py in my python site-packages, although I have the matlab folder in packages.I am having trouble using the matlab python engine. I tried this piece of code from the mathworks website:
import matlab.engine
if __name__ == ‘__main__’:
eng = matlab.engine.start_matlab()
x = 4.0
eng.workspace[‘y’] = x
a = eng.eval(‘sqrt(y)’)
print(a)
pass
But pycharm is giving me an error saying "ModuleNotFoundError: No module named ‘matlab.engine’; ‘matlab’ is not a package". I am using python 3.6 and matlab 2018. I saw that these are the supported versions on website, I saw a similar post about this problem but I can’t even run my program from python command line. I also can’t find teh matlab.py in my python site-packages, although I have the matlab folder in packages. I am having trouble using the matlab python engine. I tried this piece of code from the mathworks website:
import matlab.engine
if __name__ == ‘__main__’:
eng = matlab.engine.start_matlab()
x = 4.0
eng.workspace[‘y’] = x
a = eng.eval(‘sqrt(y)’)
print(a)
pass
But pycharm is giving me an error saying "ModuleNotFoundError: No module named ‘matlab.engine’; ‘matlab’ is not a package". I am using python 3.6 and matlab 2018. I saw that these are the supported versions on website, I saw a similar post about this problem but I can’t even run my program from python command line. I also can’t find teh matlab.py in my python site-packages, although I have the matlab folder in packages. matlab python engine, pycharm, passing python variables to matlab MATLAB Answers — New Questions