Note: While it's possible to open a virtual environment folder as a workspace, doing so is not recommended and might cause issues with using the Python extension. Be aware that if you're not using a virtual environment, and you have multiple versions of Python installed and set in the path environment variable, you might need to specify the Python interpreter to use in the terminal for installing packages to the global environment. When you then run a Python program within that environment, you know that it's running against only those specific packages.
When you activate the virtual environment, any packages you install are installed only in that environment's subfolder. A virtual environment is a subfolder in a project that contains a copy of a specific interpreter.
Such clutter makes it difficult to thoroughly test an application against a specific set of packages with known versions, which is exactly the kind of environment you'd set up on a build server or web server.įor this reason, developers often create a virtual environment for a project. Accordingly, any packages that you install or uninstall affect the global environment and all programs that you run within that context.Īlthough working in the global environment is an easy way to get started, that environment will, over time, become cluttered with many different packages that you've installed for different projects. For example, if you just run python (Windows) or python3 (macOS/Linux) at a new command prompt, you're running in that interpreter's global environment. Global and virtual environmentsīy default, any Python interpreter that you've installed runs in its own global environment, which is not specific to any one project. The Python tutorial () might also be helpful if you're new to the Python language. Note: If you're looking to get started with Python in Visual Studio Code, refer to the tutorial Getting Started with Python in VS Code. If you're new to working with Python environments, you can learn more at Virtual Environments and Packages () and Installing Python Modules ().
While this article provides some information about Python environments and their concepts, it is primarily for understanding how to work with them within VS Code.
This article discusses the helpful features provided by the VS Code Python extension for working with Python environments.
It will be closed automatically if no further activity occurs. This issue has been automatically marked as stale because it has not had recent activity. Hi there, thank you for your contribution to Conda! Sphinxcontrib-websupport 1.1.0 p圓5_1 defaults Singledispatch 3.4.0.3 p圓5h0cd4ec3_0 defaults Prompt_toolkit 1.0.15 p圓5hc09de7a_0 defaults Ipython_genutils 0.2.0 p圓5hc9e07d0_0 defaults Gst-plugins-base 1.14.0 hbbd80ab_1 defaults Get_terminal_size 1.0.0 haa9412d_0 defaults # packages in environment at /home/bob/anaconda3/envs/astm:īackports.shutil_get_terminal_size 1.0.0 p圓5_2 defaultsĬonstantly 15.1.0 p圓5h28b3542_0 defaultsĬryptography 2.3.1 p圓5hc365091_0 defaults