{"id":3269,"date":"2024-01-05T22:19:35","date_gmt":"2024-01-05T16:49:35","guid":{"rendered":"https:\/\/smarttech101.com\/?p=3269"},"modified":"2024-01-05T22:20:12","modified_gmt":"2024-01-05T16:50:12","slug":"how-to-use-virtual-environments-in-python","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/","title":{"rendered":"How to Use Virtual Environments in Python"},"content":{"rendered":"\n<p class=\"\">Virtual Environments are isolated environments. In contemporary software development, the need for <strong>isolated environments<\/strong> has become paramount to ensure the stability and integrity of systems.Tools such as npm, pip, flatpak, and others have emerged as indispensable solutions for creating isolated environments. Unlike traditional methods, these tools are designed to shield your system and other packages from potential conflicts and complications. By encapsulating applications and their dependencies, they not only enhance portability but also prevent pollution of the underlying system.<\/p>\n\n\n\n<p class=\"\">One notable example is the utilization of virtual environments in Python, where a specific Python version and its associated dependencies are encapsulated independently of the system-wide configurations. This isolation is crucial for maintaining project-specific requirements without affecting the overall system. This isolated environment operates as a self-contained unit, impervious to alterations in system-wide dependencies or Python versions. As a result, developers can confidently experiment with different versions of packages or Python itself within their project, secure in the knowledge that any changes made will not disrupt the stability of the broader system or conflict with other projects.<\/p>\n\n\n\n<p class=\"\"><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#Methods_to_Create_Virtual_Environments_in_Python\" title=\"Methods to Create Virtual Environments in Python\">Methods to Create Virtual Environments in Python<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#Step_1_Create_the_Virtual_Environment\" title=\"Step 1: Create the Virtual Environment\">Step 1: Create the Virtual Environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#Step_2_Activate_the_Virtual_Environment\" title=\"Step 2: Activate the Virtual Environment\">Step 2: Activate the Virtual Environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#Step_3_Do_Anything_in_Virtual_Environments\" title=\"Step 3: Do Anything in Virtual Environments\">Step 3: Do Anything in Virtual Environments<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#Step_4_Deactivate_the_Virtual_Environment\" title=\"Step 4: Deactivate the Virtual Environment\">Step 4: Deactivate the Virtual Environment<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Methods_to_Create_Virtual_Environments_in_Python\"><\/span>Methods to Create Virtual Environments in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"\">venv<\/li>\n\n\n\n<li class=\"\">conda<\/li>\n\n\n\n<li class=\"\">mini-conda<\/li>\n\n\n\n<li class=\"\">pyenv<\/li>\n\n\n\n<li class=\"\">virtualenv<\/li>\n<\/ul>\n\n\n\n<p class=\"\">In this article, I focused on creating the virtual environment using venv. Other methods are similar.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Create_the_Virtual_Environment\"><\/span>Step 1: Create the Virtual Environment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>$ python -m &lt;module name&gt; &lt;module argument&gt;<\/code><\/pre>\n\n\n\n<p class=\"\">Now use the module <code>venv<\/code> to create the virtualenv called <code>sample-env<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ python -m venv sample-env<\/code><\/pre>\n\n\n\n<p class=\"\">It will create a directory <code>sample-env<\/code> if it does not exist and then create a virtual environment called <code>sample-env<\/code>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"\">It creates a python binary in the directory <code>sample-env<\/code>; if your system has multiple binaries, use <code>python2<\/code>, <code>python3<\/code>, \u2026 in the first command instead of <code>python<\/code>.<\/li>\n\n\n\n<li class=\"\">It also creates other files like <code>activate<\/code>, <code>activate.fish<\/code>, etc.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Activate_the_Virtual_Environment\"><\/span>Step 2: Activate the Virtual Environment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>$ source sample-env\/bin\/activate<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"\">It activates the given virtual environment.<\/li>\n\n\n\n<li class=\"\"><code>activate<\/code> is a bash script; use <code>activate.csh<\/code> or <code>activate.fish<\/code> depending on your shell.<\/li>\n\n\n\n<li class=\"\">The prompt changes. <code>(sample-env)<\/code> is prepended before the original prompt. It tells you that you are in the virtual environment <code>sample-env<\/code>.<\/li>\n<\/ul>\n\n\n\n<p class=\"\">Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"191\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-47-10.084502571.png?resize=614%2C191&#038;ssl=1\" alt=\"activate virtual environment\" class=\"wp-image-3278\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Do_Anything_in_Virtual_Environments\"><\/span>Step 3: Do Anything in Virtual Environments<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"\">Now you can install\/update any package or do anything without worrying about affecting your system outside the directory <code>sample-env<\/code>.<\/p>\n\n\n\n<p class=\"\"><strong>Install a Package Using pip<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip install pywal<\/code><\/pre>\n\n\n\n<p class=\"\">Output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1053\" height=\"194\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-16.700801023.png?resize=1053%2C194&#038;ssl=1\" alt=\"install python packages using pip\" class=\"wp-image-3270\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-16.700801023.png?w=1053&amp;ssl=1 1053w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-16.700801023.png?resize=768%2C141&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\"><strong>Install the Given Version of a Package Using pip<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip install pywal==1.0.0<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1484\" height=\"429\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-12.954478262.png?resize=1484%2C429&#038;ssl=1\" alt=\"Install the Given Version of a Package Using pip\" class=\"wp-image-3271\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-12.954478262.png?w=1484&amp;ssl=1 1484w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-12.954478262.png?resize=768%2C222&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\"><strong>Upgrade a Package Using pip<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip install --upgrade pywal<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1050\" height=\"285\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-27.987054927.png?resize=1050%2C285&#038;ssl=1\" alt=\"Upgrade a Package Using pip\" class=\"wp-image-3272\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-27.987054927.png?w=1050&amp;ssl=1 1050w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-27.987054927.png?resize=768%2C208&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\"><strong>Uninstall Packages Using pip<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip uninstall pywal<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1052\" height=\"210\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-37.049322928.png?resize=1052%2C210&#038;ssl=1\" alt=\"Uninstall Packages Using pip\" class=\"wp-image-3273\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-37.049322928.png?w=1052&amp;ssl=1 1052w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-37.049322928.png?resize=768%2C153&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\"><strong>Display Information About a Package<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip show beautifulsoup4<\/code><\/pre>\n\n\n\n<p class=\"\"><code>show<\/code> displays information about the given package which is installed.<\/p>\n\n\n\n<p class=\"\">Output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1058\" height=\"372\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-52.650039716.png?resize=1058%2C372&#038;ssl=1\" alt=\"Display Information About a Package\" class=\"wp-image-3274\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-52.650039716.png?w=1058&amp;ssl=1 1058w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-38-52.650039716.png?resize=768%2C270&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\"><strong>Display All Packages Installed in the Virtual Environment<\/strong><\/p>\n\n\n\n<p class=\"\"><code>list<\/code> displays all packages installed in the virtual environment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip list<\/code><\/pre>\n\n\n\n<p class=\"\">Output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1053\" height=\"253\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-34.477044450.png?resize=1053%2C253&#038;ssl=1\" alt=\"Display All Packages Installed in the Virtual Environment\" class=\"wp-image-3275\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-34.477044450.png?w=1053&amp;ssl=1 1053w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-34.477044450.png?resize=768%2C185&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\"><code>freeze<\/code> is similar to <code>list<\/code> but used with <code>&gt; requirements.txt<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip freeze &gt; requirements.txt<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1053\" height=\"169\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-42.269759006.png?resize=1053%2C169&#038;ssl=1\" alt=\"freeze in pip\" class=\"wp-image-3276\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-42.269759006.png?w=1053&amp;ssl=1 1053w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/2024-01-04_21-39-42.269759006.png?resize=768%2C123&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"\">It is used for package shipment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ python -m pip install -r requirements.txt<\/code><\/pre>\n\n\n\n<p class=\"\">It will install the packages mentioned in <code>requirements.txt<\/code>.<\/p>\n\n\n\n<p class=\"\">Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Collecting pywal==0.7.2 (from -r requirements.txt (line 1))\n  ...\nInstalling collected packages: pywal\nSuccessfully installed pywal-0.7.2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Deactivate_the_Virtual_Environment\"><\/span>Step 4: Deactivate the Virtual Environment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>(sample-env) $ deactivate<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"\">Virtual environments are essential tools in Python development, providing a controlled and isolated space for managing dependencies. Whether using venv or other methods, developers can confidently work on projects without worrying about conflicts or disruptions to the broader system. This flexibility enhances the development process, allowing for experimentation and version control while maintaining the overall stability of the system. Incorporating virtual environments into your workflow is a best practice that contributes to the reliability and reproducibility of Python projects.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Discover the essentials of Python virtual environments with a focus on venv. This concise guide outlines steps for creating, activating, and managing isolated environments, allowing seamless experimentation with packages. Ideal for developers seeking practical insights into maintaining project-specific requirements while ensuring system-wide stability. Master the art of leveraging virtual environments for efficient and reliable Python project development.<\/p>\n","protected":false},"author":2,"featured_media":3280,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17],"tags":[18],"class_list":["post-3269","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line-tools","tag-command-line-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Virtual Environments in Python | SmartTech101<\/title>\n<meta name=\"description\" content=\"Learn how to create, and manage virtual environments. How to use it to maintain project-specific requirements while ensuring system-stability.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Virtual Environments in Python | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"Learn how to create, and manage virtual environments. How to use it to maintain project-specific requirements while ensuring system-stability.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-05T16:49:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-05T16:50:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"How to Use Virtual Environments in Python\",\"datePublished\":\"2024-01-05T16:49:35+00:00\",\"dateModified\":\"2024-01-05T16:50:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\"},\"wordCount\":499,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1\",\"keywords\":[\"Command Line Tools\"],\"articleSection\":[\"Command Line Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\",\"url\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\",\"name\":\"How to Use Virtual Environments in Python | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1\",\"datePublished\":\"2024-01-05T16:49:35+00:00\",\"dateModified\":\"2024-01-05T16:50:12+00:00\",\"description\":\"Learn how to create, and manage virtual environments. How to use it to maintain project-specific requirements while ensuring system-stability.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720,\"caption\":\"How to Use Virtual Environments in Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Virtual Environments in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Virtual Environments in Python | SmartTech101","description":"Learn how to create, and manage virtual environments. How to use it to maintain project-specific requirements while ensuring system-stability.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Virtual Environments in Python | SmartTech101","og_description":"Learn how to create, and manage virtual environments. How to use it to maintain project-specific requirements while ensuring system-stability.","og_url":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/","og_site_name":"SmartTech101","article_published_time":"2024-01-05T16:49:35+00:00","article_modified_time":"2024-01-05T16:50:12+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"How to Use Virtual Environments in Python","datePublished":"2024-01-05T16:49:35+00:00","dateModified":"2024-01-05T16:50:12+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/"},"wordCount":499,"commentCount":0,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1","keywords":["Command Line Tools"],"articleSection":["Command Line Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/","url":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/","name":"How to Use Virtual Environments in Python | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1","datePublished":"2024-01-05T16:49:35+00:00","dateModified":"2024-01-05T16:50:12+00:00","description":"Learn how to create, and manage virtual environments. How to use it to maintain project-specific requirements while ensuring system-stability.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1","width":1280,"height":720,"caption":"How to Use Virtual Environments in Python"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/how-to-use-virtual-environments-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"How to Use Virtual Environments in Python"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2024\/01\/How-to-Use-Virtual-Environments-in-Python.png?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/3269"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=3269"}],"version-history":[{"count":4,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/3269\/revisions"}],"predecessor-version":[{"id":3282,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/3269\/revisions\/3282"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/3280"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=3269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=3269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=3269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}