I solved this issue a few months ago. Created a tool that essentially allows the use of multiple envs at once, with their own versions of packages at any level.
program
├── dependency_a
│ └── dependency_c (1.0.0)
└── dependency_b
└── dependency_c (2.0.0)
Otherwise, you've created a magic layer hack to enable multi-version dependency chains in a mono-version dependency chain language. monolith -> openai
monolith -> langchain-openai -> openai
openai, thus, is both a direct and indirect dependency. langchain-openai recently had a vulnerability, and the patch fix is only after a major upgrade to openai. Thus, to upgrade langchain-openai here, I also need to upgrade monolith's use of openai. (From v1 to v2.)