Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Thoth prescriptions for resolving Python dependencies

September 22, 2021
Fridolin Pokorny
Related topics:
Data scienceArtificial intelligenceOpen sourcePythonSecure coding
Related products:
Red Hat Enterprise Linux

    Python offers a wealth of programming libraries, which often invoke functions from other libraries in complex hierarchies. While these libraries make it possible to develop powerful applications quickly, the ever-changing library versions often introduce conflicts that cause runtime or build-time issues. Thoth, an open source project developed within the Artificial Intelligence Center of Excellence (AICoE), is dedicated to alleviating this problem in Python programs. This article looks at Thoth prescriptions, a mechanism that you can use to avoid clashing library versions in your Python applications.

    Note: For more about resolving Python project dependencies with Thoth, see our recent introduction to Thoth Dependency Monkey.

    Curated knowledge about Python libraries

    One of Thoth's major offerings is a cloud-based resolver, which examines the packages and libraries requested by an application and determines the best way to resolve them so that they work together in the target environment. Thoth's prescription repository is comparable to the more familiar security project from the Python Packaging Authority (PyPA), a curated database of known vulnerabilities in the Python ecosystem. The Python Advisory DB resulting from that project is now available on GitHub. The repository contains YAML files describing known vulnerabilities in machine-readable form.

    Whereas the Python Advisory DB focuses only on security flaws, Thoth prescriptions are more generic and are directly consumed by the resolver. The database curates a broad range of knowledge about Python libraries and packages: Their communities, known build-time issues, runtime issues, compatibility with native dependencies, suggestions for which runtime to use, or other suggestions of interest to Python package consumers.

    Prescription information is stored as YAML files and used automatically by the Thoth resolver to guide Python application developers. Anyone can contribute to this database. The Thoth resolver automatically loads prescriptions and consults them during the resolution process, so that resolved dependencies are in a healthy state. As a result, developers can focus on application development rather than on fixing library issues. Unlike other resolvers, such as pip, Pipenv, or Poetry, which tend to resolve the latest libraries, Thoth’s resolver chooses the libraries that best fit the application's needs, and takes the prescriptions into consideration.

    Examples of Thoth prescriptions at work

    In a previous article, the Project Thoth team showed an issue in the TensorFlow software stack that occurred when urrlib3 was installed with package six. The problem is recorded in a prescription that helps the Thoth resolver avoid trying to combine problematic versions of these packages. Applications using the Thoth resolver do not suffer from this recognized runtime problem.

    Another example is a Pillow issue that will not work with NumPy. A prescription is provided to protect Python application stacks from this issue.

    Yet another example warns users about the archived argparse project. Using archived projects on GitHub that suffer from the problem might drive users away, so this prescription notifies users about the project state.

    Browse the Thoth prescriptions repository or documentation for more examples.

    Watch a video about Thoth prescriptions

    Are you curious about how "greatest" stacks are resolved? This video introduces a community-curated database that Thoth users can benefit from:

     

    Note: see Healing Python applications with prescriptions for a video overview of the prescriptions concept. Visit the Thoth Station YouTube channel for more videos like these.

    Calling all Python developers and package maintainers!

    If you are a Python developer or Python package maintainer, we encourage you to get involved in building the prescriptions database. You can report issues to be turned into prescriptions, which are used to help create healthy Python applications.

    If you would like to report a library issue, reach out to us at the Thoth Station support repository. You can also write prescriptions directly by following the online documentation. If you would like to be notified when a new prescription is created for a library, add yourself to the repository's CODEOWNERS file to follow per-project prescription updates.

    Helping the Python community create healthy applications

    As part of Project Thoth, we are accumulating knowledge to help Python developers create healthy applications. If you would like to follow updates in project Thoth, subscribe to our YouTube channel or follow us on the @ThothStation Twitter handle.

    Last updated: September 19, 2022

    Related Posts

    • Resolve Python dependencies with Thoth Dependency Monkey

    • Managing Python dependencies with the Thoth JupyterLab extension

    • AI software stack inspection with Thoth and TensorFlow

    • Continuous learning in Project Thoth using Kafka and Argo

    Recent Posts

    • Testing infrastructure red teaming with abliterated models

    • Build an enterprise RAG system with OGX

    • Solutions for SELinux MCS challenges with GitLab runners

    • MCP servers vs. skills: Choosing the right context for your AI

    • How to route external and local LLMs with Models-as-a-Service

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.