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

In idle, 25 % CPU #676

Closed
amilapsn opened this issue Nov 26, 2017 · 3 comments
Closed

In idle, 25 % CPU #676

amilapsn opened this issue Nov 26, 2017 · 3 comments
Labels
lib-misc Issues pertaining to misc. 3rd-party libraries.

Comments

@amilapsn
Copy link

amilapsn commented Nov 26, 2017

When I import moviepy.editor as mpy on a jupyter notebook the CPU load related to the python kernel of notebook becomes around 25%.
Why is it?
(I recently installed pygame. I've got a hunch that that's behind _it.)_

Edit

Yep. The reason is pygame.
After commenting out following lines in editor.py issue was resolved.

try:
    from moviepy.video.io.preview import show, preview
except ImportError:
    def preview(self, *args, **kwargs):
        """NOT AVAILABLE : clip.preview requires Pygame installed."""
        raise ImportError("clip.preview requires Pygame installed")
    def show(self, *args, **kwargs):
        """NOT AVAILABLE : clip.show requires Pygame installed."""
        raise ImportError("clip.show requires Pygame installed")


VideoClip.preview = preview
VideoClip.show = show

try:
    from moviepy.audio.io.preview import preview
except ImportError:
    def preview(self, *args, **kwargs):
        """ NOT AVAILABLE : clip.preview requires Pygame installed."""
        raise ImportError("clip.preview requires Pygame installed")

AudioClip.preview = preview

May be the problem is behind my pygame-1.9.3 installation.

If someone can help me to resolve this in a better way it would be great.

Edit

Found this:
pygame/pygame#331

@keikoro keikoro added the lib-misc Issues pertaining to misc. 3rd-party libraries. label Nov 26, 2017
@Zulko
Copy link
Owner

Zulko commented Nov 26, 2017

There must be a way to tell pygame to quit, like this:

import moviepy.editor as mpe
import pygame
pygame.quit()

@amilapsn
Copy link
Author

Yeah. Thats better.

@Zulko
Copy link
Owner

Zulko commented Nov 29, 2017

Ok. Closing the issue then.

@Zulko Zulko closed this as completed Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib-misc Issues pertaining to misc. 3rd-party libraries.
Projects
None yet
Development

No branches or pull requests

3 participants