You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the testpython jupyter_translate.py 01_intro.ipynb --language 'pt' command with the provided script jupyter_translate.py, I encountered an AttributeError: 'NoneType' object has no attribute 'group' error. The error occurs in the context of using regular expressions and the group attribute, but I'm having difficulty pinpointing the exact source of the issue.
I expected the script to execute without errors and successfully translate the Jupyter Notebook content into the specified language.
Actual Behavior:
The script encountered an AttributeError: 'NoneType' object has no attribute 'group' error during execution.
Error Stack Trace:
Traceback (most recent call last):
File "jupyter_translate.py", line XXX, in jupyter_translate
...
result = match.group()
AttributeError: 'NoneType' object has no attribute 'group'
Code Snippet:
Here's the relevant portion of the code where the error occurs:
# ... (other code)# Inside jupyter_translate function# ...ifcell['cell_type'] =='markdown':
ifsource[:3] =='```':
skip_row=notskip_row# Invert flag until I find next code blockifnotskip_row:
ifsourcenotin ['```\n', '```', '\n'] andsource[:4] !='<img':
# The following line is where the error occursdata_translated['cells'][i]['source'][j] =translate_markdown(source, dest_language=language)
# ... (other code)
Additional Information:
Python version: 3.9.16
Operating System: mac
The text was updated successfully, but these errors were encountered:
Testing this tool i ran into the same issue as you in Python 3.11.4.
Then, at the bottom of the documentation it indicates that to set it up to work in the conda environment, you need to install a specific version of the googletranslate package. So i modified the requirements.txt file to have the package version to match the one in environment.yml
requirements.txt
fire
googletrans==3.1.0a0
After that, just install the new requirements.
pip install -r requirements.txt
Should install the specific version of the googletrans package, and in my case, that solved the issue.
Description:
Issue Summary:
When running the
testpython jupyter_translate.py 01_intro.ipynb --language 'pt'
command with the provided scriptjupyter_translate.py
, I encountered anAttributeError: 'NoneType' object has no attribute 'group'
error. The error occurs in the context of using regular expressions and thegroup
attribute, but I'm having difficulty pinpointing the exact source of the issue.Steps to Reproduce:
Expected Behavior:
I expected the script to execute without errors and successfully translate the Jupyter Notebook content into the specified language.
Actual Behavior:
The script encountered an
AttributeError: 'NoneType' object has no attribute 'group'
error during execution.Error Stack Trace:
Code Snippet:
Here's the relevant portion of the code where the error occurs:
Additional Information:
The text was updated successfully, but these errors were encountered: