{"flag":true,"single":true,"pageTitle":"How to create virtual environment in python on windows manually","post":{"id":41,"user_id":"1","slug":"how-to-create-virtual-environment-in-python-on-windows-manually-mkqw","title":"How to create virtual environment in python on windows manually","body":"<p>In Python, a virtual environment is a tool that allows you to create an&nbsp;<strong>isolated Python environment<\/strong> with its own dependencies and packages separate from the system-wide Python installation.<\/p>\r\n<p>You need to run below command to create and activate virtual envoirnment<\/p>\r\n<pre class=\"language-markup\"><code>pip install virtualenv # if not installed already\r\nvirtualenv venv #venv is the folder name you can use anyone\r\nvenv\\Scripts\\activate #It will activate virtual envoirenment<\/code><\/pre>\r\n<p><strong>Benifits of virtual envoirnment:<\/strong><\/p>\r\n<ol>\r\n<li><strong>Isolation:<\/strong> Each project have seperate Python packages and dependencies.<\/li>\r\n<li><strong>Reproducibility:<\/strong> Developers can use the same virtual environment to ensure that their environment matches yours.<\/li>\r\n<li><strong>Flexibility:<\/strong> Virtual environments allow you to experiment with different packages and configurations without affecting the system-wide Python installation.<\/li>\r\n<li><strong>Dependency management:<\/strong> Virtual environments make it easier to manage dependencies for your Python projects. You can use pip to install packages within the virtual environment, and you can easily see which packages are installed and their versions.<\/li>\r\n<li><strong>Security:<\/strong> Virtual environments provide an added layer of security for your Python projects. By isolating your project's dependencies from the system-wide Python installation, you reduce the risk of vulnerabilities and security breaches.<\/li>\r\n<\/ol>\r\n<p><strong>EXPORT Requirements.txt file<\/strong><\/p>\r\n<pre class=\"language-markup\"><code>pip freeze &gt; requirements.txt<\/code><\/pre>\r\n<p>You need to install modules before use, Activate venv, and then install this command...<\/p>\r\n<pre class=\"language-markup\"><code>pip install -r requirements.txt<\/code><\/pre>","category_id":"5","is_private":"0","created_at":"2023-03-23T08:16:55.000000Z","updated_at":"2024-01-26T02:15:15.000000Z","category":{"id":5,"user_id":"1","name":"Python","slug":"python-6gqr","parent_id":null,"created_at":"2023-03-16T12:36:56.000000Z","updated_at":"2023-03-16T12:36:56.000000Z"},"user":{"id":1,"name":"R GONDAL","email":"rizikmw@gmail.com","email_verified_at":null,"two_factor_confirmed_at":null,"current_team_id":"1","profile_photo_path":null,"created_at":"2023-03-12T10:49:33.000000Z","updated_at":"2025-01-10T12:59:00.000000Z","profile_photo_url":"https:\/\/ui-avatars.com\/api\/?name=R+G&color=7F9CF5&background=EBF4FF"}},"pageDesc":"In Python, a virtual environment is a tool that allows you to create an&nbsp;isolated Python environment with its own dependencies and packa - How to create virtual environment in python on windows manually (Updated: January 26, 2024) - Read more about How to create virtual environment in python on windows manually at my programming site [SITE]","categories":[]}