This also helps other users of your software since a virtual environment will help others reproduce the exact environment for which your software was built. ![]() Using a requirements.txt file, you can define exact version numbers for the required packages to make sure your project will always work with a version that has been tested with your code. Virtual environments make it easy to define and install the packages specific to your project. After all, APIs can change significantly on major version upgrades.Ī virtual environment fixes this problem by isolating your project from other projects and system-wide packages. Great! But once you did this, it turns out your Project A code broke badly. You upgrade library X to the latest version, and project B starts working fine. Say, for example, you need the latest version for another project you started, called Project B. In the future, you might need to upgrade library X. Suppose your project, Project A, is written against a specific version of library X. There’s a problem with this approach that may start to unfold weeks or months later, however. ![]() ![]() ![]() After all, you only need to install it once, saving you precious time and disk space. If you install third-party packages system-wide, you could argue that you’re very efficient. There are multiple reasons why virtual environments are a good idea.
0 Comments
Leave a Reply. |