Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 118: invalid continuation byte #2

Open
StatProACADEMY opened this issue Jun 18, 2021 · 0 comments

Comments

@StatProACADEMY
Copy link

Hello everyone .I am trying to display a text animation using manim _notebook package in jupyter notebook.
My text is in french .In french language , there are letters characters like "é' or "ê".When i try to display an animation of a text with such characters, i get this error :


SyntaxError Traceback (most recent call last)
[... skipping hidden 1 frame]

in
----> 1 get_ipython().run_cell_magic('manim', '-x', 'class test(Scene):\n def construct(self):\n text = Text("Estimation par la méthode du maximum de vraisenblance ", font="impact").scale(2)\n self.play(Write(text))\n')

~\AppData\Roaming\Python\Python38\site-packages\IPython\core\interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2398 args = (magic_arg_s, cell)
-> 2399 result = fn(*args, **kwargs)
2400 return result

~\anaconda3\lib\site-packages\manim_notebook\manim_cell.py in manim(line, cell)
53 #manim functions
---> 54 config = manimlib.config.get_configuration(args)
55 manimlib.constants.initialize_directories(config)

~\anaconda3\lib\site-packages\manimlib\config.py in get_configuration(args)
154 def get_configuration(args):
--> 155 module = get_module(args.file)
156 file_writer_config = {

~\anaconda3\lib\site-packages\manimlib\config.py in get_module(file_name)
149 module = importlib.util.module_from_spec(spec)
--> 150 spec.loader.exec_module(module)
151 return module

~\anaconda3\lib\importlib_bootstrap_external.py in exec_module(self, module)

~\anaconda3\lib\importlib_bootstrap_external.py in get_code(self, fullname)

~\anaconda3\lib\importlib_bootstrap_external.py in source_to_code(self, data, path, _optimize)

~\anaconda3\lib\importlib_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 19: invalid continuation byte (temp.py, line 4)

During handling of the above exception, another exception occurred:

UnicodeDecodeError Traceback (most recent call last)
[... skipping hidden 1 frame]

~\AppData\Roaming\Python\Python38\site-packages\IPython\core\interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2045 # Though this won't be called by syntax errors in the input
2046 # line, there may be SyntaxError cases with imported code.
-> 2047 self.showsyntaxerror(filename, running_compiled_code)
2048 elif etype is UsageError:
2049 self.show_usage_error(value)

~\AppData\Roaming\Python\Python38\site-packages\IPython\core\interactiveshell.py in showsyntaxerror(self, filename, running_compiled_code)
2107 # If the error occurred when executing compiled code, we should provide full stacktrace.
2108 elist = traceback.extract_tb(last_traceback) if running_compiled_code else []
-> 2109 stb = self.SyntaxTB.structured_traceback(etype, value, elist)
2110 self._showtraceback(etype, value, stb)
2111

~\AppData\Roaming\Python\Python38\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, value, elist, tb_offset, context)
1401 and isinstance(value.lineno, int):
1402 linecache.checkcache(value.filename)
-> 1403 newtext = linecache.getline(value.filename, value.lineno)
1404 if newtext:
1405 value.text = newtext

~\anaconda3\lib\linecache.py in getline(filename, lineno, module_globals)
14
15 def getline(filename, lineno, module_globals=None):
---> 16 lines = getlines(filename, module_globals)
17 if 1 <= lineno <= len(lines):
18 return lines[lineno-1]

~\anaconda3\lib\linecache.py in getlines(filename, module_globals)
45
46 try:
---> 47 return updatecache(filename, module_globals)
48 except MemoryError:
49 clearcache()

~\anaconda3\lib\linecache.py in updatecache(filename, module_globals)
135 try:
136 with tokenize.open(fullname) as fp:
--> 137 lines = fp.readlines()
138 except OSError:
139 return []

~\anaconda3\lib\codecs.py in decode(self, input, final)
320 # decode input (taking the buffer into account)
321 data = self.buffer + input
--> 322 (result, consumed) = self._buffer_decode(data, self.errors, final)
323 # keep undecoded input until the next call
324 self.buffer = data[consumed:]

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 118: invalid continuation byte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant