#With the 2026 updates to both Fusion 360 and Python 3.14, the following works for me:
import adsk.core, adsk.fusion, adsk.cam, traceback
import subprocess, sys
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
try:
subprocess.check_call([sys.path[0] + '\Python\python.exe', "-m", "ensurepip", "--upgrade"])
ui.messageBox("Pip installed.")
except Exception as e:
ui.messageBox("Failed to install Pip.")
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
try:
subprocess.check_call([sys.path[0] + '\Python\python.exe', "-m", "pip", "install", 'scipy'])
subprocess.check_call([sys.path[0] + '\Python\python.exe', "-m", "pip", "install", 'numpy'])
ui.messageBox("Packages installed.")
except Exception as e:
ui.messageBox("Failed to install packages.")
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
try:
import scipy
import numpy as np
ui.messageBox("Import succeeded!")
except Exception as e:
ui.messageBox("Failed when importing packages.")
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))