{"id":24005,"library":"mandrill","title":"Mandrill (deprecated, use mailchimp-transactional)","description":"Mandrill is a Python client library for the Mandrill email as a service platform. As of version 1.0.60, the library is deprecated and replaced by mailchimp-transactional. No new releases are expected; users should migrate to the new library.","status":"deprecated","version":"1.0.60","language":"python","source_language":"en","source_url":"https://github.com/mandrill/mandrill-python","tags":["mandrill","email","deprecated","mailchimp-transactional"],"install":[{"cmd":"pip install mandrill","lang":"bash","label":"Install deprecated Mandrill client"}],"dependencies":[],"imports":[{"note":"MandrillAPI is not a module; the correct class is Mandrill.","wrong":"from mandrill import MandrillAPI","symbol":"Mandrill","correct":"import mandrill\nm = mandrill.Mandrill(api_key='YOUR_API_KEY')"},{"note":"Client was an alias used in very early versions; the official current class is Mandrill.","wrong":"from mandrill import Client","symbol":"Mandrill","correct":"from mandrill import Mandrill"}],"quickstart":{"code":"import mandrill\n\nm = mandrill.Mandrill(api_key=os.environ.get('MANDRILL_API_KEY', ''))\ntry:\n    result = m.messages.send(message={'subject': 'Hello', 'from_email': 'sender@example.com', 'to': [{'email': 'recipient@example.com'}]})\n    print(result)\nexcept mandrill.Error as e:\n    print('Error:', e)","lang":"python","description":"Sends an email using the Mandrill API. Requires MANDRILL_API_KEY environment variable."},"warnings":[{"fix":"Migrate to the mailchimp-transactional library: pip install mailchimp-transactional","message":"This library is deprecated in favor of mailchimp-transactional. New features and bug fixes are not being added.","severity":"deprecated","affected_versions":"1.0.60 and all versions"},{"fix":"Use 'from mandrill import Mandrill' instead of 'from mandrill import MandrillAPI'.","message":"In version 1.0.50, the class name changed from MandrillAPI to Mandrill. Old import will break.","severity":"breaking","affected_versions":">=1.0.50"},{"fix":"Install with 'pip install mandrill --use-deprecated=legacy-resolver' or use mailchimp-transactional.","message":"The library does not support Python 3.12+ due to removed distutils dependency. Some users report install failures.","severity":"gotcha","affected_versions":">=3.12"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Downgrade to version <1.0.50, or import as 'from mandrill import MandrillAPI'.","cause":"Using an older version of the library where the class was named MandrillAPI.","error":"ImportError: cannot import name 'Mandrill' from 'mandrill'"},{"fix":"Ensure the MANDRILL_API_KEY environment variable is set to a valid Mandrill API key.","cause":"The provided API key is incorrect or not set.","error":"mandrill.Error: Invalid API key"},{"fix":"Install setuptools: 'pip install setuptools' and retry. Or migrate to mailchimp-transactional.","cause":"Python 3.12+ removed distutils, which the mandrill package depends on.","error":"ModuleNotFoundError: No module named 'distutils'"},{"fix":"Change import to 'from mandrill import Mandrill'.","cause":"Using old import pattern with new library version (>=1.0.50).","error":"AttributeError: module 'mandrill' has no attribute 'MandrillAPI'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}