HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/kohya_ss/setup/check_local_modules.py
import argparse
import subprocess

# Define color variables
yellow_text = "\033[1;33m"
blue_text = "\033[1;34m"
reset_text = "\033[0m"

# Parse command line arguments
parser = argparse.ArgumentParser()
parser.add_argument('--no_question', action='store_true')
args = parser.parse_args()

# Run pip freeze and capture the output
output = subprocess.getoutput("pip freeze")

# Remove lines containing "WARNING"
output_lines = [line for line in output.splitlines() if "WARNING" not in line]

# Reconstruct the output string without warning lines
output = "\n".join(output_lines)

# Check if modules are found in the output
if output:
    print(f"{yellow_text}=============================================================")
    print("Modules installed outside the virtual environment were found.")
    print("This can cause issues. Please review the installed modules.\n")
    print("You can uninstall all local modules with:\n")
    print(f"{blue_text}deactivate")
    print("pip freeze > uninstall.txt")
    print("pip uninstall -y -r uninstall.txt")
    print(f"{yellow_text}============================================================={reset_text}")
    print('')