Python Matlab Engine Error - python

I am using the Matlab Engine for Python.
When I try to run the command:
matlab.engine.find_matlab()
in the python prompt, I get the following error:
AttributeError: 'module' object has no attribute 'find_matlab'
I looked into the source code of the corresponding module (matlabeninge.py), there is no 'find_matlab' method in it, or other methods listed in the Mathworks documentation.
Though I can properly start a Matlab session using:
matlab.engine.matlab_startup()
I tried reinstalling both Matlab & the Python package, nothing changed. It's as if the module lacks some code.
Has anyone else encountered this?

Please try to follow the example listed here
The syntax is :
names = matlab.engine.find_matlab()
did that solve the issue ?

I used the following line to solve a similar issue: (so I imported matlab.engine two times)
import matlab.engine
I called eng = matlab.engine.start_matlab('-desktop') after it and got the following error message without the import:
AttributeError: 'int' object has no attribute 'engine'

Related

How to fix "attributeerror module 'numba' has no attribute 'core'"

I am using the package sktime and I wanted to use the RocketClassifier. Somehow when I run from sktime.classification.kernel_based import RocketClassifier from the python console it works. But when I run the code in a Jupyter Notebook (VS Code) I get following error: attributeerror module 'numba' has no attribute 'core.
I have numba version 58.0.4. Have someone maybe a solution for that or can someone explain me, why it is not working?

sift.SiftPlan giving AttributeError: 'NoneType' object has no attribute 'create_context'

I am using Ubuntu environment and python 3.6. When i run "sift_ocl = sift.SiftPlan(template=image, devicetype="GPU")" then I am facing below error:
"AttributeError: 'NoneType' object has no attribute 'create_context'".
Few platforms also mentioned to check "import pyopencl" and it is also giving error on import "ImportError: libsvml.so: cannot open shared object file: No such file or directory", for which I didn't find exact solution.
I tried similar problems solution which are posted online and having ****.so dynamically linked shared object libraries issues but didn't work for me.
Please guide me, thanks.

jupyter notebook raises AttributeError

I am using a jupyter notebook to test my python package but jupyter raises the following issue when I try to run my package:
AttributeError: module 'logging' has no attribute 'config'
There is a similar question here: Jupyter Notebook - Attribute Error: 'module' object has no attribute 'F_OK'
But the solution (downgrade conda and python) is not satisfying to me. Does anyone have another idea? For now I just comment the line in my code and it works but it is not very handy...
You only need to add import logging.config and it should fix your issue.

matplotlib - AttributeError: module 'numbers' has no attribute 'Integral'

I am a newbie to python and i am trying to learn online. I tried importing matplotlib on python 3.6 but i keep getting this error:
problem in matplotlib - AttributeError: module 'numbers' has no attribute 'Integral'.
I am using Anaconda. and i have installed the matplotlib library too. I have no idea what is going on. Please help.
As you told us in your comment, your file is named numbers.py. This file is probably the problem, as it hides the numbers.py file used by matplotlib. Your numbers.py file does not provide the Integral attribute, thus the error message.
Solution: Rename your file.

Import only works in interpreter

import twitter
api = twitter.Api(consumer_key='consumer_key',
consumer_secret= 'consumer_secret',
access_token_key='access_token_key',
access_token_secret='access_token_secret')
Above code works fine in the interpreter and I am able to get the information that I am looking for. However, python importScript.py with the exact contents above gives error:
AttributeError: 'module' object has no attribute 'Api'
I am not sure what the issue is and have searched for related issues with no resolution. My python interpreter and command are the same version.

Categories

Resources