Best practices for building Python environments: Mamba + Conda + PIP

Previously, we introduced PIP and Conda separately. In subsequent practical applications, we still encountered many problems in Python environment construction, especially on Windows systems. The most prominent performance is: although PIP's package dependency parsing and downloading are both It's fast, but on Windows, Python programs often report errors when starting because of missing underlying dependent libraries (such as certain dll files). At this time, switching to Conda can usually solve such problems. However, the problem with Conda is : Its package dependency resolution is a big problem and takes a long time. The way to solve this problem with Conda is to introduce Mamba. Mamba can be regarded as an improved version of Conda. Its usage (commands and parameters) are exactly the same as Conda. , it does not completely rewrite Conda, but focuses on improving Conda's package dependency parsing and downloading functions, solving the pain points mentioned above. In addition, Mamba/Conda's Channel may not be able to provide all the packages that the program depends on. In this case, PIP must be used to install these packages. Therefore, at present, Mamba + Conda + PIP is an ideal way to build a Python environment on Windows systems. kind of combination.

This article takes the projecthttps://github.com/alejandro-ao/ask-multiple-pdfs as an example to introduce its use. Mamba + Conda + PIP the entire process of building its environment. ask-multiple-pdfs is a simple LLM application. For novices, building this project on Windows is not an easy task. Although requirements.txt files are provided in the project, the entire package can be completed using PIP

Guess you like

Origin blog.csdn.net/bluishglc/article/details/133897696