Python VS Code problem with object has no attribute group - python

I just started with Python. I had watched a video on youtube about googletrans library, when I tried it on my VS Code, I had this issue. Can anyone help me?
P/s: This is the link to the video that I have watched: https://www.youtube.com/watch?v=IBqLWm47mjM
Thanks all.
[enter image description here][1]
[1]: https://i.stack.imgur.com/JQjVC.png

This issue has related to the package release, it is not related to you or your system, you can use this specific version to preventing from the issue: 4.0.0rc1
pip install googletrans==4.0.0rc1
Also, you can find more solutions here:
googletrans stopped working with error 'NoneType' object has no attribute 'group'

Related

AttributeError: h5py.h5.H5PYConfig' has no attribute '__reduce_cython__'

I'm trying to run this github repo on my machine but I faced this issue
Also, I tried to use different h5py version but without getting any benefit
can anyone help me?

I can't understand why googletrans in python isn't working, it gives error: AttributeError: 'NoneType' object has no attribute 'group'

I was just trying to understand how to use googletrans in python and I wrote out the following code:
from googletrans import Translator
translator = Translator()
result = translator.translate('Mikä on nimesi', src='fi', dest='fr')
print(result.src)
print(result.dest)
print(result.text)
But for some reason it gives me the error message:
AttributeError: 'NoneType' object has no attribute 'group'
I have installed google translate with pip install googletrans, and was trying to follow the instructions on this site: https://py-googletrans.readthedocs.io/en/latest/ but for some reason it doesn't work. I'm running on kali linux operating system. Could someone please explain to me how to fix the issue?
Ps: here's a screenshot of the message:
Googletrans is currently broken. From the docs can be seen that de build is failing. Seeing a D for maintainability doesn't look good, but I'm not familiar with this benchmark.
You could try an older version that is passing the build, or fix the issue because it's open-source.
Use googletrans version 3.1.0a0 or above.

AttributeError: 'Lines_LineSeries_LineIterator_DataAccessor_Strateg' object has no attribute 'analyers'

I've searched for this question on the internet and I didn't find any suitable answers, so I'm posting this question. My code is in this link.
Error:
AttributeError: 'Lines_LineSeries_LineIterator_DataAccessor_Strateg' object has no attribute 'analyzers'
The error is actually coming from this line in the file lineseries.py, which comes with pycharm when installed:
return getattr(self.lines, name)
If you want to see the full code, it is in this link.
I went to every link that showed up in the search, but none of them helped. I tried deleting the 'self' in the line above as someone suggested on Github, but that didn't work.
Thanks for all the help. I know my code is pretty long, so sorry for that.
Note: I'm using windows 10 with the version python 3.7 installed on my system.

I can't create an recognizer using the lastest opencv version

I'm' trying to build a face recognition project with python. But I've found a problem, I can't instantiate the recognizer because when I try execute this line:
recognizer = cv2.face.LBHFaceRecognizer_create()
I got this error:
AttributeError: module 'cv2.cv2' has no attribute 'face'
So I've searched for a solution in the web, much of them, suggested to execute this command on terminal:
pip install opencv-contrib-python
it doesn't solve the problem, I've tried to reinstall to but the problem remains. I've seek information about the documentation but it looks that there's a miss of information about how to create an recognizer in the web.Do Someone know how to solve the problem?
It works for me with a slight modification:
recognizer = cv2.face.LBPHFaceRecognizer_create()
I added a P after LB.
I have a working example here
If someone knows how to solve the problem this post shows exactly the solution for this problems step by step, it's only follow the first answer:
No module named 'cv2.cv2'

Python 'midi' has no attribute 'Pattern'

Recently I've been trying out machine learning with tensorflow. This tutorial, has me stuck because I keep getting the error: AttributeError: module 'midi' has no attribute 'Pattern' Does anyone know how to fix this error? I've tried installing py-midi (pip), python-midi (github), and the midi module (pip). However, the midi module never installed properly ("Could not find a version that satisfies the requirement midi"). I'm using python 3.5
My code:
import midi
pattern = midi.Pattern()
track = midi.Track()
pattern.append(track)
-Thanks in advance!
Fixed this error by installing the module directly from git: pip install git+https://github.com/vishnubob/python-midi#feature/python3 Found this command on this github page.

Categories

Resources