import streamlit as st st.title("MoviePy Import Test") try: import moviepy.editor st.success("Successfully imported moviepy.editor!") st.write(f"MoviePy version (if accessible): {getattr(moviepy, '__version__', 'N/A')}") # You can add a simple moviepy operation here if the import works # from moviepy.editor import TextClip # try: # clip = TextClip("Hello", fontsize=70, color='white') # st.write("Created a TextClip object.") # except Exception as e_clip: # st.error(f"Error creating TextClip: {e_clip}") except ModuleNotFoundError as e_mod: st.error(f"ModuleNotFoundError: {e_mod}") st.error("moviepy.editor could not be imported.") except Exception as e: st.error(f"An unexpected error occurred during import: {e}") st.subheader("Installed Packages (pip list):") import subprocess import sys try: result = subprocess.run([sys.executable, "-m", "pip", "list"], capture_output=True, text=True, check=True) st.code(result.stdout) except Exception as e_pip: st.error(f"Error running pip list: {e_pip}")