{"id":27417,"library":"spotinst-agent-2","title":"Spotinst Agent 2","description":"Spectrum instance spotinst-agent that runs remote scripts, collects data, deploys applications, and more. Version 2.0.11, Python 3 only. Maintained by Spotinst.","status":"active","version":"2.0.11","language":"python","source_language":"en","source_url":"https://github.com/spotinst/spotinst-spectrum-agent","tags":["spotinst","agent","scripts","cloud"],"install":[{"cmd":"pip install spotinst-agent-2","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Old package name or wrong module path","wrong":"from spotinst_agent import Agent","symbol":"SpotinstAgent","correct":"from spotinst_agent_2.agent import SpotinstAgent"},{"note":"Incorrect top-level import","wrong":"from spotinst_agent import run_script","symbol":"run_script","correct":"from spotinst_agent_2.scripts import run_script"}],"quickstart":{"code":"from spotinst_agent_2.agent import SpotinstAgent\n\nagent = SpotinstAgent(token=os.environ.get('SPOTINST_TOKEN', ''))\nresult = agent.run_script('echo Hello from Agent')\nprint(result)","lang":"python","description":"Initialize the agent with a Spotinst token and run a script."},"warnings":[{"fix":"Use Python 3.6+.","message":"Python 2 is not supported; only Python 3.x is compatible.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Change imports to spotinst_agent_2.","message":"The old import 'from spotinst_agent import ...' is deprecated. Use 'spotinst_agent_2' package.","severity":"deprecated","affected_versions":"2.0.0+"},{"fix":"Set SPOTINST_TOKEN environment variable or pass token parameter.","message":"The token is required; if missing, scripts fail silently.","severity":"gotcha","affected_versions":"all"},{"fix":"Use callback or polling if needed.","message":"Script execution is asynchronous; results may not be immediate.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install spotinst-agent-2 and use 'from spotinst_agent_2...'","cause":"Installed wrong package or using old import.","error":"ModuleNotFoundError: No module named 'spotinst_agent'"},{"fix":"Check SPOTINST_TOKEN environment variable or token parameter.","cause":"Token missing or invalid.","error":"AttributeError: 'NoneType' object has no attribute 'status'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}