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

[BUG] Cannot import manim slides to any project #334

Open
martinprad0 opened this issue Dec 8, 2023 · 7 comments
Open

[BUG] Cannot import manim slides to any project #334

martinprad0 opened this issue Dec 8, 2023 · 7 comments
Labels
bug Something isn't working waiting author Waiting author response

Comments

@martinprad0
Copy link

Description

When running the command from manim_slides import Slide I get the following error

---------------------------------------------------------------------------
PydanticUserError                         Traceback (most recent call last)
[/home/martin/Documents/VSCode/Python/Manim/Thesis-P1.ipynb](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/Thesis-P1.ipynb) Cell 3 line 1
----> [1](vscode-notebook-cell:/home/martin/Documents/VSCode/Python/Manim/Thesis-P1.ipynb#W4sZmlsZQ%3D%3D?line=0) from manim_slides import Slide

File [~/.local/lib/python3.12/site-packages/manim_slides/__init__.py:3](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/__init__.py:3)
      [1](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/__init__.py:1) # flake8: noqa: F401
      [2](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/__init__.py:2) from .__version__ import __version__
----> [3](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/__init__.py:3) from .slide import Slide, ThreeDSlide

File [~/.local/lib/python3.12/site-packages/manim_slides/slide.py:9](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/slide.py:9)
      [5](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/slide.py:5) from typing import Any, List, Optional
      [7](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/slide.py:7) from tqdm import tqdm
----> [9](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/slide.py:9) from .config import PresentationConfig, SlideConfig, SlideType
     [10](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/slide.py:10) from .defaults import FOLDER_PATH
     [11](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/slide.py:11) from .manim import FFMPEG_BIN, MANIMGL, Scene, ThreeDScene, config, logger

File [~/.local/lib/python3.12/site-packages/manim_slides/config.py:51](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:51)
     [46](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:46)             logger.debug(f"Pressed key: {self.name}")
     [48](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:48)         return m
---> [51](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:51) class Config(BaseModel):  # type: ignore
     [52](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:52)     """General Manim Slides config"""
     [54](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:54)     QUIT: Key = Key(ids=[Qt.Key_Q], name="QUIT")

File [~/.local/lib/python3.12/site-packages/manim_slides/config.py:62](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/manim_slides/config.py:62), in Config()
...
    [245](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/VSCode/Python/Manim/~/.local/lib/python3.12/site-packages/pydantic/deprecated/class_validators.py:245) def dec(f: Callable[..., Any] | classmethod[Any, Any, Any] | staticmethod[Any, Any]) -> Any:

PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.

Version

I get the same error when running manim-slides --version, but with pip list | grep manim-slides i get the following output

manim-slides            4.7.0

Platform

OS: Fedora Linux 39 (Workstation Edition) x86_64
Kernel: 6.6.3-200.fc39.x86_64

pip is installed though rpm

Screenshots

No response

Additional information

No response

@martinprad0 martinprad0 added the bug Something isn't working label Dec 8, 2023
@jeertmans
Copy link
Owner

Hello, this is weird… can you try to upgrade to Manim Slide v5?

@martinprad0
Copy link
Author

I run pip3 install --upgrade manim-slides, then I get from pip list | grep manim-slides the same version. I think the issue is that I'm unable to upgrade.

@jeertmans
Copy link
Owner

What message do you get after upgrading?

also, the issue might be that you have multiple Manim-slides versions installed, probably because you have multiple Python versions installed?

@martinprad0
Copy link
Author

What message do you get after upgrading?

also, the issue might be that you have multiple Manim-slides versions installed, probably because you have multiple Python versions installed?

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: manim-slides in ./.local/lib/python3.12/site-packages (4.7.0)
Requirement already satisfied: click>=8.0 in ./.local/lib/python3.12/site-packages (from manim-slides) (8.1.7)
Requirement already satisfied: click-default-group>=1.2 in ./.local/lib/python3.12/site-packages (from manim-slides) (1.2.4)
Requirement already satisfied: numpy>=1.19.3 in ./.local/lib/python3.12/site-packages (from manim-slides) (1.26.2)
Requirement already satisfied: opencv-python>=4.6 in ./.local/lib/python3.12/site-packages (from manim-slides) (4.8.1.78)
Requirement already satisfied: pydantic>=1.9.1 in ./.local/lib/python3.12/site-packages (from manim-slides) (2.5.2)
Requirement already satisfied: pyside6>=6 in ./.local/lib/python3.12/site-packages (from manim-slides) (6.6.1)
Requirement already satisfied: requests>=2.26.0 in /usr/lib/python3.12/site-packages (from manim-slides) (2.28.2)
Requirement already satisfied: tqdm>=4.62.3 in /usr/lib/python3.12/site-packages (from manim-slides) (4.66.1)
Requirement already satisfied: annotated-types>=0.4.0 in ./.local/lib/python3.12/site-packages (from pydantic>=1.9.1->manim-slides) (0.6.0)
Requirement already satisfied: pydantic-core==2.14.5 in ./.local/lib/python3.12/site-packages (from pydantic>=1.9.1->manim-slides) (2.14.5)
Requirement already satisfied: typing-extensions>=4.6.1 in ./.local/lib/python3.12/site-packages (from pydantic>=1.9.1->manim-slides) (4.8.0)
Requirement already satisfied: shiboken6==6.6.1 in ./.local/lib/python3.12/site-packages (from pyside6>=6->manim-slides) (6.6.1)
Requirement already satisfied: PySide6-Essentials==6.6.1 in ./.local/lib/python3.12/site-packages (from pyside6>=6->manim-slides) (6.6.1)
Requirement already satisfied: PySide6-Addons==6.6.1 in ./.local/lib/python3.12/site-packages (from pyside6>=6->manim-slides) (6.6.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3.12/site-packages (from requests>=2.26.0->manim-slides) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.12/site-packages (from requests>=2.26.0->manim-slides) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.12/site-packages (from requests>=2.26.0->manim-slides) (1.26.18)

@jeertmans
Copy link
Owner

Ooh I think I know, this is because you are using Python 3.12 but Manim Slides v5 is not available on Python 3.12, mainly because one of its dependencies is not available :/

can you check if you can install PySide6?

If you can, I will release a new version for your Python version.
Otherwise, you might need to install Python 3.11 or earlier :/

@martinprad0
Copy link
Author

martinprad0 commented Dec 8, 2023

can you check if you can install PySide6?

Yup already installed.

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: PySide6 in ./.local/lib/python3.12/site-packages (6.6.1)
Requirement already satisfied: shiboken6==6.6.1 in ./.local/lib/python3.12/site-packages (from PySide6) (6.6.1)
Requirement already satisfied: PySide6-Essentials==6.6.1 in ./.local/lib/python3.12/site-packages (from PySide6) (6.6.1)
Requirement already satisfied: PySide6-Addons==6.6.1 in ./.local/lib/python3.12/site-packages (from PySide6) (6.6.1)

@jeertmans
Copy link
Owner

Oh yeah I just remember that the Pyside v6.6.1 is broken, and you cannot enjoy the normal Manim Slides experience. You will experience flashing black screens in between slides :/

I reported that issue to their team, but not update yet: https://bugreports.qt.io/browse/QTBUG-118501.

In the meantime, if you don't mind the small visual bug (only when using manim-slides present), you can install the latest version with:

git clone https://github.com/jeertmans/manim-slides.git

or just download this proect files.

Modify the PySide6 version in pyproject.toml to be 6.6.1.

Run poetry lock to update the lock file.

Then run pip install . to install Manim Slides v5.

@jeertmans jeertmans added the waiting author Waiting author response label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting author Waiting author response
Projects
None yet
Development

No branches or pull requests

2 participants