print("Starting VPython test...")
problem_found = False
try:
import vpython as vp
print(f"Successfully imported vpython as vp.")
except ImportError as e:
print(f"CRITICAL: Failed to import vpython: {e}")
problem_found = True
if not problem_found:
try:
version_info = "N/A"
if hasattr(vp, '__version__'):
version_info = vp.__version__
print(f"VPython version: {version_info}")
except Exception as e:
print(f"Error accessing VPython version: {e}")
problem_found = True
if not problem_found:
try:
print("Attempting to create vp.vector(1,2,3)...")
v = vp.vector(1,2,3)
print(f"Successfully created vp.vector: {v}")
except AttributeError as e:
print(f"ATTRIBUTE_ERROR during vp.vector creation: {e}")
problem_found = True
# Crucial Test Point for quaternion
if not problem_found:
try:
print("Attempting to access the vp.quaternion attribute itself (to see if it even exists)...")
quat_class_ref = vp.quaternion # This line just tries to access the attribute
print(f"Successfully accessed vp.quaternion. Type: {type(quat_class_ref)}")
print("Attempting to create vp.quaternion() instance...")
q = vp.quaternion() # This line tries to instantiate it
print(f"Successfully created vp.quaternion instance: {q}")
except AttributeError as e:
print(f"ATTRIBUTE_ERROR related to vp.quaternion: {e}")
problem_found = True