I have installed a nimble package with versions 0.2.0 and 0.4.0. Version 0.4.0 breaks API compatibility, and some older software still works with 0.2.0. How can I write an import to use installed version 0.2.0 instead of the more recent 0.4.0?
You can't write an import to do that. What you're supposed to do is specify the version requirements in your .nimblefile then use nimble buildto build your program.