def print_status() -> None:
"""Print the current status of the Matrix (virtual environment)."""
if is_venv():
+ print()
print("MATRIX STATUS: Welcome to the construct")
+ print()
print(f"Current Python: {sys.executable}")
print(f"Virtual Environment: {get_venv_name()}")
print(f"Environment Path: {sys.prefix}")
+ print()
print("SUCCESS: You're in an isolated environment!")
print("Safe to install packages without affecting")
print("the global system.")
+ print()
print("Package installation path:")
- # site.getsitepackages() might return multiple paths,
- # usually we want the one in sys.prefix
site_packages = site.getsitepackages()
for path in site_packages:
if path.startswith(sys.prefix):
print(path)
break
else:
+ print()
print("MATRIX STATUS: You're still plugged in")
+ print()
print(f"Current Python: {sys.executable}")
print("Virtual Environment: None detected")
+ print()
print("WARNING: You're in the global environment!")
print("The machines can see everything you install.")
+ print()
print("To enter the construct, run:")
print("python -m venv matrix_env")
print("source matrix_env/bin/activate # On Unix")
print("matrix_env\\Scripts\\activate # On Windows")
+ print()
print("Then run this program again.")