{"id":3087,"date":"2022-07-27T12:47:27","date_gmt":"2022-07-27T12:47:27","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=3087"},"modified":"2025-09-25T15:04:25","modified_gmt":"2025-09-25T10:04:25","slug":"python-3-install-virtualenv","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/","title":{"rendered":"Python 3 Install Virtualenv"},"content":{"rendered":"<p>By building isolated <span style=\"color: #3366ff;\"><strong><a style=\"color: #3366ff;\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/\">Python 3 Install Virtualenv<\/a><\/strong><\/span> for them. A virtual environment is a tool that aids in maintaining the separation of dependencies needed by various projects. The majority of Python developers utilize this as one of their most crucial tools.<\/p>\n<p>Consider a situation where you are working on two Python web projects. One of which utilizes Django 1.9, the other Django 1.10, etc. Virtual environments can be particularly helpful in these circumstances to manage the dependencies of both projects.<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/3toHB_do7oM\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 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\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><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><\/span><\/a><\/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:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#How_and_when_should_a_virtual_environment_be_used\" >How and when should a virtual environment be used?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#How_does_a_Python_3_Install_Virtualenv_Setting_Operate\" >How does a Python 3 Install Virtualenv Setting Operate?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#How_can_I_set_up_Windows_with_Virtualenv_Python_3\" >How can I set up Windows with Virtualenv Python 3?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#How_do_I_tell_Virtualenv_what_version_of_Python_to_use\" >How do I tell Virtualenv what version of Python to use?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#In_Python_3_how_can_I_establish_a_Virtualenv\" >In Python 3, how can I establish a Virtualenv?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#How_can_I_add_the_Python_path_on_Windows\" >How can I add the Python path on Windows?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-virtualenv\/#In_Virtualenv_Windows_how_do_I_use_a_different_version_of_Python\" >In Virtualenv Windows, how do I use a different version of Python?<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_and_when_should_a_virtual_environment_be_used\"><\/span><strong>How and when should a virtual environment be used?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>By default, these directories will be used by all projects on your system to store and retrieve site-packages (third-party libraries). How is this relevant? You have two versions of Django in the two projects mentioned above. Given that Python cannot distinguish between different versions in the &#8220;site-packages&#8221; directory. This is a significant issue.<\/p>\n<p>As a result, the same directory with the same name would house both v1.9 and v1.10. Virtual environments are useful in this situation. We just need to set up two distinct virtual environments for the two projects to overcome this issue. The great thing about this is that they are just directories with a few scripts inside of them. There are no restrictions on how many environments you can have.<\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-and-when-should-a-virtual-environment-be-used-1.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-13856\" title=\"how and when should a virtual environment be used\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-and-when-should-a-virtual-environment-be-used-1-300x157.jpg\" alt=\"how and when should a virtual environment be used\" width=\"730\" height=\"382\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-and-when-should-a-virtual-environment-be-used-1-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-and-when-should-a-virtual-environment-be-used-1-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-and-when-should-a-virtual-environment-be-used-1-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-and-when-should-a-virtual-environment-be-used-1.jpg 1200w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p>When working on any Python 3 Install Virtualenv-based project. You should always use a virtual environment. Generally speaking, it is a good idea to create a fresh virtual environment for each Python 3 Install Virtualenv-based project you work on. As a result, each project&#8217;s dependencies are kept separate from both the system and one another.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_does_a_Python_3_Install_Virtualenv_Setting_Operate\"><\/span><strong>How does a Python 3 Install Virtualenv Setting Operate?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To establish isolated Python environments. We make use of the virtualenv module. A folder containing all the executables required to use the packages that a Python project would need is created by virtualenv.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_can_I_set_up_Windows_with_Virtualenv_Python_3\"><\/span><strong>How can I set up Windows with Virtualenv Python 3?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-set-up-windows-with-virtualenv-python.jpg\"><img decoding=\"async\" class=\"alignnone  wp-image-13858\" title=\"how can i set up windows with virtualenv python\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-set-up-windows-with-virtualenv-python-300x157.jpg\" alt=\"how can i set up windows with virtualenv python\" width=\"732\" height=\"383\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-set-up-windows-with-virtualenv-python-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-set-up-windows-with-virtualenv-python-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-set-up-windows-with-virtualenv-python-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-set-up-windows-with-virtualenv-python.jpg 1200w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/a><\/p>\n<p><strong>Windows Pip and Python 3 Install Virtualenv<\/strong><\/p>\n<ol>\n<li><code>Set up pip Official Pip (Python Package Installer) documentation.<\/code><\/li>\n<li><code>Virtualenv in your Command Prompt.<\/code><\/li>\n<li><code>Activate virtualenv. Navigate to your project in the Command Prompt<\/code><\/li>\n<li><code>Another method of installing pip. Save the \"EZ setup.py\" file from https:\/\/bootstrap.pypa.io\/ez setup.py to your computer's desktop.<\/code><\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"How_do_I_tell_Virtualenv_what_version_of_Python_to_use\"><\/span><strong>How do I tell Virtualenv what version of Python to use?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Any new environment you build will automatically utilize that version of Python 3 Install Virtualenv. The -p switch, however, allows you to select any installed version of Python to use in a new environment. $ virtualenv -p python3. 2 my env running virtualenv using the \/usr\/local\/bin\/python3 interpreter<\/p>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-do-i-tell-virtualenv-what-version-of-python-to-use-1.jpg\"><img decoding=\"async\" class=\"alignnone  wp-image-13859\" title=\"how do i tell virtualenv what version of python to use\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-do-i-tell-virtualenv-what-version-of-python-to-use-1-300x157.jpg\" alt=\"how do i tell virtualenv what version of python to use\" width=\"730\" height=\"382\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-do-i-tell-virtualenv-what-version-of-python-to-use-1-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-do-i-tell-virtualenv-what-version-of-python-to-use-1-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-do-i-tell-virtualenv-what-version-of-python-to-use-1-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-do-i-tell-virtualenv-what-version-of-python-to-use-1.jpg 1200w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p><strong>A Text File<\/strong><\/p>\n<ul>\n<li><code>Go to the directory containing requirements.txt.<\/code><\/li>\n<li><code>turn on your virtual environment.<\/code><\/li>\n<li><code>In your shell, type pip installs -r requirements.txt.<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"In_Python_3_how_can_I_establish_a_Virtualenv\"><\/span><strong>In Python 3, how can I establish a Virtualenv?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/in-python-3-how-can-i-establish-a-virtualenv-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13860\" title=\"in python 3 how can i establish a virtualenv\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/in-python-3-how-can-i-establish-a-virtualenv-1-300x157.jpg\" alt=\"in python 3 how can i establish a virtualenv\" width=\"730\" height=\"382\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/in-python-3-how-can-i-establish-a-virtualenv-1-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/in-python-3-how-can-i-establish-a-virtualenv-1-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/in-python-3-how-can-i-establish-a-virtualenv-1-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/in-python-3-how-can-i-establish-a-virtualenv-1.jpg 1200w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p><strong>Python 3 Install Virtualenv:<\/strong><\/p>\n<ul>\n<li><code>First, install pip. Install Python3-Pip with sudo apt-get.<\/code><\/li>\n<li><code>then utilize pip3 to install virtualenv.<\/code><\/li>\n<li><code>Make a simulated setting now.<\/code><\/li>\n<li><code>A Python interpreter of your choosing may also be used.<\/code><\/li>\n<li><code>Your virtual environment is active.<\/code><\/li>\n<li><code>Fish shell usage<\/code><\/li>\n<li><code>To turn off:<\/code><\/li>\n<li><code>Utilize Python 3 to create virtualenv.<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"How_can_I_add_the_Python_path_on_Windows\"><\/span><strong>How can I add the Python path on Windows?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-add-the-python-path-of-window.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-13861\" title=\"how can i add the python path of window\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-add-the-python-path-of-window-300x157.jpg\" alt=\"how can i add the python path of window\" width=\"732\" height=\"383\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-add-the-python-path-of-window-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-add-the-python-path-of-window-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-add-the-python-path-of-window-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/how-can-i-add-the-python-path-of-window.jpg 1200w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/a><\/p>\n<p><strong>How to add Python to Windows&#8217; PATH variable?<\/strong><\/p>\n<ul>\n<li>The Properties menu can be accessed by right-clicking This PC.<\/li>\n<li>Select the Advanced system settings option from the left menu.<\/li>\n<li>Select the Environment Variables button. Which is located in the bottom right.<\/li>\n<li>Selecting the Path variable and clicking Edit in the System variables section.<\/li>\n<li>by selecting New and choosing the Python installation location.<\/li>\n<\/ul>\n<p><code>To prevent conflicts between different versions of Python running on the same machine. Python 3 Install Virtualenv is designed to install to a directory that contains the version number. For example, Python version 2.7 will install to C: Python27. Naturally, there can only be one interpreter set as the default program for Python file formats.<\/code><\/p>\n<h2><span class=\"ez-toc-section\" id=\"In_Virtualenv_Windows_how_do_I_use_a_different_version_of_Python\"><\/span><strong>In Virtualenv Windows, how do I use a different version of Python?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>TL; DR<\/p>\n<ul>\n<li><code>Pip install virtualenv should be typed into the Command Prompt window.<\/code><\/li>\n<li><code>Remember the path to new python.exe of the freshly installed version and download the required Python 3 Install Virtualenv (DO NOT ADD TO PATH!).<\/code><\/li>\n<li><code>Open Command Prompt and type virtualenv to start one.<\/code><\/li>\n<\/ul>\n<p><strong>Related Article<\/strong><\/p>\n<ul>\n<li><span style=\"color: #808000;\"><strong><a style=\"color: #808000;\" href=\"https:\/\/arzhost.com\/blogs\/python-3-install-pip3\/\">python 3 install pip3<\/a><\/strong><\/span><\/li>\n<li><span style=\"color: #808000;\"><strong><a style=\"color: #808000;\" href=\"https:\/\/arzhost.com\/blogs\/python-activate-virtual-environment\/\">python activate virtual env<\/a><\/strong><\/span><\/li>\n<li><span style=\"color: #808000;\"><strong><a style=\"color: #808000;\" href=\"https:\/\/arzhost.com\/blogs\/python3-create-virtual-environment\/\">python3 creates virtual env<\/a><\/strong><\/span><\/li>\n<li><span style=\"color: #808000;\"><strong><a style=\"color: #808000;\" href=\"https:\/\/arzhost.com\/blogs\/create-virtual-environment-python-3\/\">Create Virtual Environment Python 3<\/a><\/strong><\/span><\/li>\n<li><span style=\"color: #808000;\"><strong><a style=\"color: #808000;\" href=\"https:\/\/arzhost.com\/blogs\/make-virtual-env-python3\/\">Make Virtual Env Python3<\/a><\/strong><\/span><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>By building isolated Python 3 Install Virtualenv for them. A virtual environment is a tool that aids in maintaining the separation of dependencies needed by various projects. The majority of Python developers utilize this as one of their most crucial tools. Consider a situation where you are working on two Python web projects. One of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3089,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,16,19],"tags":[],"table_tags":[],"class_list":["post-3087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-tutorial","category-window"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/3087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=3087"}],"version-history":[{"count":4,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/3087\/revisions"}],"predecessor-version":[{"id":13862,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/3087\/revisions\/13862"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/3089"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=3087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=3087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=3087"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/table_tags?post=3087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}