{"id":21591,"library":"morphcloud","title":"Morph Cloud SDK","description":"A Python SDK and CLI tool for creating, managing, and interacting with Morph Cloud VMs. Current version: 0.1.111. Rapid release cadence (daily/weekly).","status":"active","version":"0.1.111","language":"python","source_language":"en","source_url":"https://github.com/morphcloud/morphcloud-python","tags":["cloud","vm","sdk","cli"],"install":[{"cmd":"pip install morphcloud","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Correct import for the main client class.","wrong":"","symbol":"MorphCloudClient","correct":"from morphcloud import MorphCloudClient"},{"note":"Module-level import.","wrong":"","symbol":"morphcloud","correct":"import morphcloud"}],"quickstart":{"code":"from morphcloud import MorphCloudClient\nimport os\n\nclient = MorphCloudClient(api_key=os.environ.get('MORPH_API_KEY', ''))\n# Create a VM\nvm = client.vms.create(name='my-vm', image='ubuntu-22.04')\nprint(f\"VM ID: {vm.id}\")\n# Start the VM\nvm.start()\n# Execute a command\nresult = vm.exec('echo hello')\nprint(result.stdout)\n# Stop and destroy\nvm.stop()\nvm.destroy()","lang":"python","description":"Initialize client, create a VM, run a command, then clean up."},"warnings":[{"fix":"Set MORPH_API_KEY environment variable or pass api_key parameter to MorphCloudClient.","message":"API key must be set via environment variable MORPH_API_KEY or passed as argument. The SDK does not fall back to config files.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use the exact image name from the SDK's list_images() method or the CLI.","message":"VM image parameter does not accept image IDs from the dashboard. Use image names like 'ubuntu-22.04' or 'debian-11'.","severity":"breaking","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Check that MORPH_API_KEY environment variable is set and valid.","cause":"API key not set or incorrect.","error":"morphcloud.exceptions.AuthenticationError: Invalid API key"},{"fix":"Verify the VM ID is correct. Use client.vms.list() to find active VMs.","cause":"VM ID does not exist or has been destroyed.","error":"morphcloud.exceptions.ResourceNotFoundError: VM with id '...' not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}