問題文
Two automation scripts on the same host need conflicting versions of the same library. Which approach resolves this without changing the system-wide packages?
選択肢
- Install the newer version system-wide and pin the older one with the package manager, since the package manager keeps both on disk and the interpreter reads the pin file to decide which one to import for each script.
- Rewrite one script so both can use the same version.
- Create a separate virtual environment for each script and install the required version into each one.
- Install both versions system-wide and let the interpreter select the newer one at run time, and each script picks up the version it declares in its own import.