TypeError: Argument 'indent' has incorrect type (expected float, got int)
- 主要語言
- Python
- 星號
- 93.9k
- 分支
- 7.7k
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 4
描述
### Describe the error
meet error when I run command "manimgl example_scenes.py OpeningManimExample"
### Code and Error
**Code**:
❯ manimgl example_scenes.py OpeningManimExample
ManimGL v1.6.1
[22:51:25] INFO Using the default configuration file, which you can config.py:265
modify in
`/opt/homebrew/lib/python3.11/site-packages/manimli
b/default_config.yml`
INFO If you want to create a local configuration file, config.py:266
you can create a file named `custom_config.yml`, or
run `manimgl --config`
2024-03-17 22:51:25.425 Python[16365:187313] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/55/451gkvyx6_x1y7pkwsql0m2w0000gn/T/org.python.python.savedState
Traceback (most recent call last):
File "/opt/homebrew/bin/manimgl", line 8, in
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/__main__.py", line 25, in main
scene.run()
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/scene/scene.py", line 91, in run
self.construct()
File "/Users/bytedance/tmp/manim/example_scenes.py", line 14, in construct
intro_words = Text("""
^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/text_mobject.py", line 149, in __init__
super().__init__(text, **kwargs)
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/labelled_string.py", line 64, in __init__
super().__init__()
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/svg_mobject.py", line 65, in __init__
self.init_svg_mobject()
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/svg_mobject.py", line 76, in init_svg_mobject
self.generate_mobject()
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/labelled_string.py", line 79, in generate_mobject
super().generate_mobject()
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/svg_mobject.py", line 91, in generate_mobject
file_path = self.get_file_path()
^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/labelled_string.py", line 68, in get_file_path
return self.get_file_path_(use_plain_file=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/labelled_string.py", line 72, in get_file_path_
return self.get_file_path_by_content(content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/text_mobject.py", line 208, in get_file_path_by_content
self.markup_to_svg(content, svg_file)
File "/opt/homebrew/lib/python3.11/site-packages/manimlib/mobject/svg/text_mobject.py", line 220, in markup_to_svg
return MarkupUtils.text2svg(
^^^^^^^^^^^^^^^^^^^^^
TypeError: Argument 'indent' has incorrect type (expected float, got int)
**Error**:
### Environment
**OS System**:
macos apple silicon
Darwin KHGXDDVHFV 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:54 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6030 arm64
**manim version**: master
ManimGL v1.6.1
**python version**:
Python 3.11.7
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
此錯誤發生在 manimlib/mobject/svg/text_mobject.py 的第220行、markup_to_svg 中,MarkupUtils.text2svg 被以錯誤類型的 'indent' 參數呼叫。請查看 call site 與 text2svg 的定義,以確認 indent 期望的類型(float vs int)。修復可能是確保傳入的 indent 值為 float。檢查程式碼庫中是否還有類似的呼叫。
由索引模型根據 Issue 內容生成。
評估
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100