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

Creating Text Mobject retrieves TypeError (manimpango.text2svg has incorrect argument typing) #106

Closed
mkashirin opened this issue Oct 13, 2023 · 10 comments · Fixed by ManimCommunity/manim#3405

Comments

@mkashirin
Copy link
Contributor

Hello.
I'm having a trouble rendering a Text Mobject. An attempt of creating a Text Mobject retrieves TypeError because manimpango.text2svg function has incorrect argument typing (size: int, line_spacing: int istead of both being float). Traceback is represented on screenshots attached.
The problem is I just don't know how to save any type of changes made to them .pyx files.

Steps to reproduce the problem:

  1. install Anaconda 3 on Windows 11 Pro;
  2. install Manim with the following command conda install -c conda-forge manim on Conda's Python 3.11.6;
  3. try to run the code from the Screenshot 1 or render the text typing manim -pqh scene.py TextAnimation.

Screenshots:
screenshot 1: Снимок экрана 2023-10-13 191126;
screenshot 2: Снимок экрана 2023-10-13 191315.

Thanks for your response.

@mkashirin mkashirin changed the title Creating Text object retrieves TypeError (manimpango.text2svg has incorrect argument typing) Creating Text Mobject retrieves TypeError (manimpango.text2svg has incorrect argument typing) Oct 13, 2023
@uwezi
Copy link

uwezi commented Oct 13, 2023

don't just use screenshots - especially not for your code!

class TextAnimation(Scene):
    def construct(self):
        text = Text("Book Antiqua", font="Book Antiqua")
        self.play(Write(text))
        self.play(Unwrite(text))

@uwezi
Copy link

uwezi commented Oct 13, 2023

Ok, I finally updated my Python to a recent Python 3.11 (not Anaconda, but plain Windows-version of Python from python.org) and I still cannot reproduce your problem.

@mkashirin
Copy link
Contributor Author

Basically, I can try installing Manim via pip into pure Python venv. Not sure it'll help, but still...

@mkashirin
Copy link
Contributor Author

So, I installed it manually into the pure Python virtual environment, created via PyCharm, and everything works just perfect. It seems like the problem with either VSCode or Conda itself.
Thanks for your response.

@naveen521kk
Copy link
Member

naveen521kk commented Oct 14, 2023

Cython 3 started to enforce type-checking more strictly which caused this issue. On normal Python, the wheel from PyPI would be installed which should be built with Cython 0.x. Conda seems to have built this project with Cython 3.

#105 seems to have fixed most of the issues, I'll do a bit more testing and release a new version.

I'll keep this open for a bit till I release a new version.

@alexandross
Copy link

I am using conda, I updated today both conda and the manimCE environment inside conda, and I started to get this error. It was working fine previously. Any assistance would be greatly appreciated. Thank you!

@behackl
Copy link
Member

behackl commented Nov 3, 2023

I am using conda, I updated today both conda and the manimCE environment inside conda, and I started to get this error. It was working fine previously. Any assistance would be greatly appreciated. Thank you!

Wait for the upcoming release, or just try and run pip install manimpango --force.

@alexandross
Copy link

Thank you! I just installed manim in my "base" environment (outside of the "manimCE" conda environment) using "pip3 install manim" and it works. I will keep updating the manimCE conda environment, hopefully a future update will fix it.

@smadikanti
Copy link

Issue still persists

@uwezi
Copy link

uwezi commented Mar 7, 2024

@smadikanti

Issue still persists

well, the issue has been fixed as reported by others.

Which version of Manim and which version of Python are you using on what operating system?
And did you follow the advice above to run pip install manimpango --force?

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

Successfully merging a pull request may close this issue.

6 participants