{"id":38823,"date":"2021-09-08T12:30:00","date_gmt":"2021-09-08T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=38823"},"modified":"2022-06-03T03:31:33","modified_gmt":"2022-06-03T08:31:33","slug":"how-to-create-a-python-virtual-environment-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/","title":{"rendered":"How to Create a Python Virtual Environment on Ubuntu 20.04"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"742\" height=\"372\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg\" alt=\"how to create a python virtual environment on ubuntu 20.04\" class=\"wp-image-38827\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04-150x75.jpg 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-full\"><img decoding=\"async\" width=\"120\" height=\"120\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/09\/create-a-python-virtual-environment-on-ubuntu-20.04.jpg\" alt=\"create a python virtual environment on ubuntu 20.04\" class=\"wp-image-38896\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we will discuss the installation and usage of Python virtual environment on Ubuntu 20.04. Python virtual environment is a directory that contains a complete Python installation for a specific version of Python, including a number of additional packages and modules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This allows users to have an unlimited number of different Python versions and modules, independent of the main version of Python installed on the system. This means that Python-based applications such as Odoo, Django or Flask, can use different Python versions and modules on a same server. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">The installation and activation of Python virtual environment is a pretty fast and straightforward process and it can be done in less than 10 minutes.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a21de112dc68\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a21de112dc68\"  aria-label=\"Toggle\" \/><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:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#Login-and-update-the-system\" >Login and update the system<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#Install-and-activate-Python-virtual-environment\" >Install and activate Python virtual environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#Create-and-activate-Python-virtual-environment\" >Create and activate Python virtual environment<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-prerequisites\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Ubuntu 20.04 VPS<\/li><li>System user with sudo or root privileges<\/li><li>SSH access to the VPS<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Login-and-update-the-system\"><\/span>Login and update the system<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to start with the creation of Python virtual environments, login to the Ubuntu 20.04 VPS via SSH<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh root@IP_Address -p Port_Number<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t forget to replace <em><strong>IP_Address<\/strong><\/em> and <strong><em>Port_Number<\/em><\/strong> with your server&#8217;s actual IP address and the SSH port number. We logged in as user root, but you can use any other system user with sudo privileges.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you are in, run the following commands to update the package index and upgrade all installed packages to the latest available version<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt update &amp;&amp; apt upgrade<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install-and-activate-Python-virtual-environment\"><\/span>Install and activate Python virtual environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Starting from Python version 3.6 we can use the <strong><em>venv <\/em><\/strong>Python module to create virtual environments. Before Python 3.6 the <strong><em>pyvenv <\/em><\/strong>module was used for the same purpose. In Ubuntu 20.04, the Python version included in the base system is Python 3.8. We can confirm this by checking the version of Python installed on our Ubuntu 20.04 VPS.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 -V<br>Python 3.8.10<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To find which package is containing the necessary <strong><em>venv <\/em><\/strong>module, we can search the Ubuntu repositories using the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-cache search venv<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output will display all available packages in the Ubuntu 20.04 repositories<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-venv - apt virtual environment<br>elpa-pyvenv - Python virtual environment interface<br>libmaven-enforcer-plugin-java - Maven build rule execution framework<br>python3-venv - pyvenv-3 binary for python3 (default python3 version)<br>python3.8-venv - Interactive high-level object-oriented language (pyvenv binary, version 3.8)<br>python3.8-full - Python Interpreter with complete class library (version 3.8)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We will be using the python3-venv package which will install the required <strong><em>venv <\/em><\/strong>module, along with some dependencies. You can use any version of Python you want available in the Ubuntu repository<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt -y install python3-venv<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the installation of the Python <strong><em>venv <\/em><\/strong>module is completed, our Ubuntu 20.04 VPS is ready for creating Python new virtual environments.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create-and-activate-Python-virtual-environment\"><\/span>Create and activate Python virtual environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To create your first Python virtual environment change the current working directory to the one you will use for your Python project. In our case, we will use the <span class=\"has-inline-color has-cyan-bluish-gray-color\"><code>\/opt\/my_first_venv<\/code> <\/span>directory. To create the virtual environment run the following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 -m venv \/opt\/my_first_venv<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command above will create a new <span class=\"has-inline-color has-cyan-bluish-gray-color\"><code>\/opt\/my_first_venv<\/code><\/span> directory and all necessary directories inside it containing a copy of the Python interpreter, the standard Python library, and several additional supporting files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ls \/opt\/my_first_venv\/<br>bin include lib lib64 pyvenv.cfg share<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To start working inside the newly created virtual environment change the current working directory and activate it with the following commands<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/opt\/<br>source my_first_venv\/bin\/activate<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the virtual environment is activated it will change your shell\u2019s prompt to display the name of the used virtual environment, as shown below<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">(my_first_venv) #<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the activation of the Python virtual environment, we can start working on our project. Or we can install and use any Python application, install or upgrade Python modules, etc. Please note that the Python application will have to be started using the Python&#8217;s binary of the newly created environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install a new Python module inside the virtual environment we can use the pip manager. For example, we will install the <strong><em>idna <\/em><\/strong>Python module:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">(my_first_venv)# pip install idna<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Collecting idna\n    Downloading idna-3.2-py3-none-any.whl (59 kB)\n    |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 59 kB 8.8 MB\/s\n    Installing collected packages: idna\nSuccessfully installed idna-3.2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After you are done working inside the Python virtual environment, you have to deactivate it. You can do it by running the deactivate command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">(my_first_venv)# deactivate<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s all. You have successfully installed and enabled Python virtual environment on your Ubuntu VPS. For more details about the Python virtual environments, you can check their <a href=\"https:\/\/docs.python.org\/3\/library\/venv.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">official documentation<\/a>. <\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, you don\u2019t need to install Python virtual environment on Ubuntu 20.04 yourself if you use one of our fully managed <strong><a href=\"https:\/\/www.rosehosting.com\/linux-vps-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">VPS Hosting<\/a><\/strong> services, in which case you can simply ask our expert Linux admins to install and set this up for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"100\" height=\"100\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/09\/python-virtual-environment-on-ubuntu-20.04.jpg\" alt=\"python virtual environment on ubuntu 20.04\" class=\"wp-image-38898\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">P.S. If you liked this post on how to install Python virtual environment on Ubuntu 20.04 please share it with your friends on the social networks by using the share shortcuts below, or simply leave a comment in the comments section. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will discuss the installation and usage of Python virtual environment on Ubuntu 20.04. Python virtual environment &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Create a Python Virtual Environment on Ubuntu 20.04\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#more-38823\" aria-label=\"Read more about How to Create a Python Virtual Environment on Ubuntu 20.04\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":38827,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[1940,155,1839,1669],"class_list":["post-38823","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-ubuntu","tag-how-to-create","tag-python","tag-ubuntu-20-04","tag-virtual-environment","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.7 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Create a Python Virtual Environment on Ubuntu 20.04<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Python Virtual Environment on Ubuntu 20.04\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-08T17:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:31:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg?v=1630313253\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Create a Python Virtual Environment on Ubuntu 20.04\" \/>\n<meta name=\"twitter:description\" content=\"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Create a Python Virtual Environment on Ubuntu 20.04\",\"datePublished\":\"2021-09-08T17:30:00+00:00\",\"dateModified\":\"2022-06-03T08:31:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/\"},\"wordCount\":715,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg\",\"keywords\":[\"how to create\",\"python\",\"Ubuntu 20.04\",\"virtual environment\"],\"articleSection\":[\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/\",\"name\":\"How to Create a Python Virtual Environment on Ubuntu 20.04\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg\",\"datePublished\":\"2021-09-08T17:30:00+00:00\",\"dateModified\":\"2022-06-03T08:31:33+00:00\",\"description\":\"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg\",\"width\":742,\"height\":372,\"caption\":\"how to create a python virtual environment on ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a Python Virtual Environment on Ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Create a Python Virtual Environment on Ubuntu 20.04","description":"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.","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:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Python Virtual Environment on Ubuntu 20.04","og_description":"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2021-09-08T17:30:00+00:00","article_modified_time":"2022-06-03T08:31:33+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg?v=1630313253","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_title":"How to Create a Python Virtual Environment on Ubuntu 20.04","twitter_description":"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Create a Python Virtual Environment on Ubuntu 20.04","datePublished":"2021-09-08T17:30:00+00:00","dateModified":"2022-06-03T08:31:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/"},"wordCount":715,"commentCount":1,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg","keywords":["how to create","python","Ubuntu 20.04","virtual environment"],"articleSection":["Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/","name":"How to Create a Python Virtual Environment on Ubuntu 20.04","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg","datePublished":"2021-09-08T17:30:00+00:00","dateModified":"2022-06-03T08:31:33+00:00","description":"In this tutorial, you will learn how to create a Python environment on Ubuntu 20.04, with ease and one step at a time.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-create-a-python-virtual-environment-on-ubuntu-20.04.jpg","width":742,"height":372,"caption":"how to create a python virtual environment on ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-a-python-virtual-environment-on-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create a Python Virtual Environment on Ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=38823"}],"version-history":[{"count":5,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38823\/revisions"}],"predecessor-version":[{"id":38899,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38823\/revisions\/38899"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/38827"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=38823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=38823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=38823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}