![]() ![]() Note that you should use python3 instead of python if your system recognizes a version of Python 2 as the default Python interpreter. To create a virtual environment in a given directory, type: Likewise, you could download a standalone copy of the Python interpreter, unpack it into a folder, and use it to run scripts and packages devoted to it. Nothing says you can’t simply unpack a Python library into a subfolder of a project and use it that way. ![]() You want to run a “baseline” version of the Python interpreter on a system with no third-party packages, and only install third-party packages for each individual project as needed.You want to experiment with a specific combination of packages under highly controlled circumstances, for instance to test cross-compatibility or backward compatibility.This may be because you’re working in a highly controlled environment, such as managed hosting, or on a server where the choice of interpreter (or packages used in it) can’t be changed because of production requirements. You’re working in a Python environment where you can’t modify the site-packages directory. ![]() You’re developing multiple projects that depend on different versions of the same packages, or you have a project that must be isolated from certain packages because of a namespace collision.There are a few common use cases for a virtual environment: Even large, complex packages with platform-dependent binaries can be corralled off from each other in virtual environments. ![]() The packages installed in each virtual environment are seen only in that virtual environment and no other. Each virtual environment contains a discrete copy of the Python interpreter, including copies of its support utilities. A virtual environment is a way to have multiple, parallel instances of the Python interpreter, each with different package sets and different configurations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |