<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ virtualenv - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ virtualenv - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Fri, 26 Jun 2026 22:47:44 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/virtualenv/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up a Django Development Environment ]]>
                </title>
                <description>
                    <![CDATA[ Django is a high-level web framework written in Python that encourages a rapid and realistic functional design. The Django web framework is free and open-source and is widely used to create both small and large web applications. In this tutorial, you... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-set-up-a-django-development-environment/</link>
                <guid isPermaLink="false">66b903942fd266308aa6ff60</guid>
                
                    <category>
                        <![CDATA[ Django ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Victoria (Burah) Poromon ]]>
                </dc:creator>
                <pubDate>Tue, 12 Dec 2023 15:52:32 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/12/DDE-cover.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Django is a high-level web framework written in Python that encourages a rapid and realistic functional design. The Django web framework is free and open-source and is widely used to create both small and large web applications.</p>
<p>In this tutorial, you will learn the following:</p>
<ul>
<li>What a development environment is,</li>
<li>What a virtual environment is,</li>
<li>How to create a Python virtual environment, and</li>
<li>How to install Django in your virtual environment.</li>
</ul>
<p>To get the most out of this tutorial, you'll need to have a basic knowledge of using a terminal/command line and have the latest stable version of Python installed on your computer.</p>
<h2 id="heading-what-is-a-development-environment">What is a Development Environment?</h2>
<p>A development environment is an installation of Django on your local computer. Setting up your environment is an important step in your website’s development process. It provides an isolated and controlled space for you to write, test, and debug your code before deploying to a production environment.</p>
<h2 id="heading-what-is-a-virtual-environment">What is a Virtual Environment?</h2>
<p>A virtual environment is a space that allows you to isolate the dependencies and configurations of one project from another. This way, you can create different projects with different versions of libraries, and they won’t interfere with each other.</p>
<p>Note that there are various types of virtual environments, but in this tutorial we'll focus on creating a Python environment.</p>
<h2 id="heading-how-to-create-a-python-virtual-environment">How to Create a Python Virtual Environment</h2>
<p>In Python, there are several tools available for creating and managing virtual environments. Here are two commonly used ones:</p>
<h3 id="heading-the-venv-tool">The <code>venv</code> tool:</h3>
<p><code>venv</code> is an in-built module that comes with Python versions 3.3 and later. It's a simple and lightweight way to create a virtual environment.</p>
<p>Here's how to create a virtual environment using <code>venv</code>:</p>
<pre><code class="lang-bash">python -m venv myenv
</code></pre>
<p><code>myenv</code> is the name of your virtual environment. You can use any other name, but always use lowercase letters and add no spaces. </p>
<p>Also, keep the name short so it is easy to remember. Dashes are allowed and commonly used. For example, <code>my-env</code> instead of <code>myenv</code>.</p>
<h3 id="heading-the-virtualenv-tool">The <code>virtualenv</code> tool:</h3>
<p><code>virtualenv</code> is a third-party tool for creating a virtual environment. Its features allow you to create an environment with a different version of Python than the one used to execute the <code>virtualenv</code> command.</p>
<p>Here's how to create a virtual environment using <code>virtualenv</code>:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># For macOS and Linux</span>
pip install virtualenv
virtualenv myenv

<span class="hljs-comment"># For windows</span>
pip install virtualenv
python -m virtualenv myenv
</code></pre>
<p><code>pip install virtualenv</code> is a command that uses the Python package manager <code>pip</code> to install <code>virtualenv</code> globally in your computer. After installation, <code>virtualenv myenv</code> creates a new virtual environment named <code>myenv</code>. </p>
<p>Just like when using the <code>venv</code> tool, you can change the name of the environment. But always remember to keep them short, use lowercase letters, and add no spaces. You can use dashes, too.</p>
<h2 id="heading-django-installation">Django Installation</h2>
<p>Django provides you with a set of Python scripts for creating and working with Django projects. It is very flexible in terms of where and how you can install it. But for this tutorial, you will be installing Django in the virtual environment you just created.</p>
<p>Here's how you can install Django in your virtual environment, for Linux and macOS:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Activate your virtual environment</span>
<span class="hljs-built_in">source</span> myenv/bin/activate

<span class="hljs-comment"># Install Django</span>
pip install django

<span class="hljs-comment"># Or use this to specify the version</span>
pip install django==4.2.7
</code></pre>
<p>For Windows:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Activate your virtual environment</span>
myenv\Scripts\activate

<span class="hljs-comment"># Install Django</span>
pip install django

<span class="hljs-comment"># Or use this to specify the version</span>
pip install django==4.2.7
</code></pre>
<p><code>pip</code> is a package installer for Python that is recommended for installing Django. The command <code>pip install django</code> downloads the latest version of Django and installs it in your Python environment.</p>
<p>After working on your project, you can deactivate your virtual environment by typing the following command into your terminal or command line:</p>
<pre><code class="lang-bash">deactivate
</code></pre>
<h3 id="heading-how-to-verify-your-django-installation">How to verify your Django installation</h3>
<p>After installation, you should verify that Django is correctly installed in your virtual environment. Always ensure to activate your virtual environment before verifying your installation.</p>
<p>Verify your Django installation with the following command:</p>
<pre><code class="lang-bash">python -m django --version
</code></pre>
<p>The above command will display the Django version installed in your virtual environment.</p>
<p>Congratulations! Your Django development environment is now active on your computer.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Django facilitates the development of web applications by providing a solid foundation, reducing repetition, and promoting best practices.</p>
<p>Installing Django is the first step in creating an environment for your web projects. After this process, you can now set up your Django project, define its structure, configure your databases, create your applications, and start building your web application. Happy Coding.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up a Virtual Environment in Python – And Why It's Useful ]]>
                </title>
                <description>
                    <![CDATA[ By Stephen Sanwo When developing software with Python, a basic approach is to install Python on your machine, install all your required libraries via the terminal, write all your code in a single .py file or notebook, and run your Python program in t... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-setup-virtual-environments-in-python/</link>
                <guid isPermaLink="false">66d4614c246e57ac83a2c7d5</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 11 Apr 2022 20:46:19 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/virtual-env-python.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Stephen Sanwo</p>
<p>When developing software with Python, a basic approach is to install Python on your machine, install all your required libraries via the terminal, write all your code in a single .py file or notebook, and run your Python program in the terminal.</p>
<p>This is a common approach for a lot of beginners and many people transitioning from working with Python for data analytics.</p>
<p>This works fine for simple Python scripting projects. But in complex software development projects, like building a Python library, an API, or software development kit, often you will be working with multiple files, multiple packages, and dependencies. As a result, you will need to isolate your Python development environment for that particular project.</p>
<p>Consider this scenario: you are working on app A, using your system installed Python and you pip install packageX version 1.0 to your global Python library. Then you switch to project B on your local machine, and you install the same packageX but version 2.0, which has some breaking changes between version 1.0 and 2.0. </p>
<p>When you go back to run your app A, you get all sorts of errors, and your app does not run. This is a scenario you can run into when building software with Python. And to get around this, we can use virtual environments.</p>
<p>This tutorial will cover everything you need to know about virtual environments and how to set one up with <strong>Virtualenv</strong>.</p>
<h2 id="heading-what-is-a-virtual-environment">What is a Virtual Environment?</h2>
<p>Python's official documentation says: </p>
<blockquote>
<p>"A virtual environment is a Python environment such that the Python interpreter, libraries and scripts installed into it are isolated from those installed in other virtual environments, and (by default) any libraries installed in a “system” Python, i.e., one which is installed as part of your operating system"</p>
</blockquote>
<p>To break this down, when you activate a virtual environment for your project, your project becomes its own self contained application, independent of the system installed Python and its modules. </p>
<p>Your new virtual environment has its own pip to install libraries, its own libraries folder, where new libraries are added, and its own Python interpreter for the Python version you used to activate the environment.</p>
<p>With this new environment, your application becomes self-contained and you get some benefits such as:</p>
<ul>
<li>Your development environment is contained within your project, becomes isolated, and does not interfere with your system installed Python or other virtual environments</li>
<li>You can create a new virtual environment for multiple Python versions</li>
<li>You are able to download packages into your project without admin privileges</li>
<li>You can easily package your application and share with other developers to replicate</li>
<li>You can easily create a list of dependencies and sub dependencies in a file, for your project, which makes it easy for other developers to replicate and install all the dependencies used within your environment</li>
</ul>
<p>Using virtual environments is recommended for software development projects that generally grow out of a single Python script, and Python provides multiple ways of creating and using a virtual environment. </p>
<p>In the sections below, we will walk through how to set up your virtual environment, using <strong>venv</strong>, which gives you a lot more low level control of your environment. </p>
<p>Another common way to set up your virtual environment is to use <strong>pipenv</strong>, which is a more high level approach.</p>
<h2 id="heading-how-to-install-a-virtual-environment-using-venv">How to Install a Virtual Environment using Venv</h2>
<p><strong>Virtualenv</strong> is a tool to set up your Python environments. Since Python 3.3, a subset of it has been integrated into the standard library under the venv module. You can install venv to your host Python by running this command in your terminal:</p>
<pre><code class="lang-bash">pip install virtualenv
</code></pre>
<p>To use venv in your project, in your terminal, create a new project folder, cd to the project folder in your terminal, and run the following command:</p>
<pre><code class="lang-bash"> python&lt;version&gt; -m venv &lt;virtual-environment-name&gt;
</code></pre>
<p>Like so:</p>
<pre><code class="lang-bash"> mkdir projectA
 <span class="hljs-built_in">cd</span> projectA
 python3.8 -m venv env
</code></pre>
<p>When you check the new projectA folder, you will notice that a new folder called <strong>env</strong> has been created. env is the name of our virtual environment, but it can be named anything you want.</p>
<p>If we check the contents of env for a bit, on a Mac you will see a bin folder. You will also see scripts that are typically used to control your virtual environment, such as activate and pip to install libraries, and the Python interpreter for the Python version you installed, and so on. (This folder will be called Scripts on windows). </p>
<p>The lib folder will contain a list of libraries that you have installed. If you take a look at it, you will see a list of the libraries that come by default with the virtual environment.</p>
<h2 id="heading-how-to-activate-the-virtual-environment">How to Activate the Virtual Environment</h2>
<p>Now that you have created the virtual environment, you will need to activate it before you can use it in your project. On a mac, to activate your virtual environment, run the code below:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> env/bin/activate
</code></pre>
<p>This will activate your virtual environment. Immediately, you will notice that your terminal path includes env, signifying an activated virtual environment. </p>
<p>Note that to activate your virtual environment on Widows, you will need to run the following code below (See this <a target="_blank" href="https://docs.python.org/3/library/venv.html">link</a> to fully understand the differences between platforms):</p>
<pre><code class="lang-bash"> env/Scripts/activate.bat //In CMD
 env/Scripts/Activate.ps1 //In Powershel
</code></pre>
<h2 id="heading-is-the-virtual-environment-working">Is the Virtual Environment Working?</h2>
<p>We have activated our virtual environment, now how do we confirm that our project is in fact isolated from our host Python? We can do a couple of things.</p>
<p>First we check the list of packages installed in our virtual environment by running the code below in the activated virtual environment. You will notice only two packages – pip and setuptools, which are the base packages that come default with a new virtual environment</p>
<pre><code class="lang-bash">pip list
</code></pre>
<p>Next you can run the same code above in a new terminal in which you haven't activated the virtual environment. You will notice a lot more libraries in your host Python that you may have installed in the past. These libraries are not part of your Python virtual environment until you install them.</p>
<h2 id="heading-how-to-install-libraries-in-a-virtual-environment">How to Install Libraries in a Virtual Environment</h2>
<p>To install new libraries, you can easily just pip install the libraries. The virtual environment will make use of its own pip, so you don't need to use pip3. </p>
<p>After installing your required libraries, you can view all installed libraries by using pip list, or you can generate a text file listing all your project dependencies by running the code below:</p>
<pre><code class="lang-bash">pip freeze &gt; requirements.txt
</code></pre>
<p>You can name this requirements.txt file whatever you want.</p>
<h2 id="heading-requirements-file">Requirements File</h2>
<p>Why is a requirements file important to your project? Consider that you package your project in a zip file (<strong>without the env folder</strong>) and you share with your developer friend. </p>
<p>To recreate your development environment, your friend will just need to follow the above steps to activate a new virtual environment. </p>
<p>Instead of having to install each dependency one by one, they could just run the code below to install all your dependencies within their own copy of the project:</p>
<pre><code class="lang-bash"> ~ pip install -r requirements.txt
</code></pre>
<p>Note that it is generally not advisable to share your env folder, and it should be easily replicated in any new environment. </p>
<p>Typically your env directory will be included in a .gitignore file (when using version control platforms like GitHub) to ensure that the environment file is not pushed to the project repository.</p>
<h2 id="heading-how-to-deactivate-a-virtual-environment">How to Deactivate a Virtual Environment</h2>
<p>To deactivate your virtual environment, simply run the following code in the terminal:</p>
<pre><code class="lang-bash"> ~ deactivate
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Python virtual environments give you the ability to isolate your Python development projects from your system installed Python and other Python environments. This gives you full control of your project and makes it easily reproducible. </p>
<p>When developing applications that would generally grow out of a simple .py script or a Jupyter notebook, it's a good idea to use a virtual environment – and now you know how to set up and start using one.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Manage Python Dependencies using Virtual Environments ]]>
                </title>
                <description>
                    <![CDATA[ By Saransh Kataria When we start building a Python project that goes beyond simple scripts, we tend to start using third-party dependencies.  When working on a larger project, we need to think about managing these dependencies in an efficient manner.... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-manage-python-dependencies-using-virtual-environments/</link>
                <guid isPermaLink="false">66d460ee9208fb118cc6d011</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 22 Mar 2021 20:39:56 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/03/0_T4VpXQchm1Vr05bL.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Saransh Kataria</p>
<p>When we start building a Python project that goes beyond simple scripts, we tend to start using third-party dependencies. </p>
<p>When working on a larger project, we need to think about managing these dependencies in an efficient manner. And when installing dependencies, we always want to be inside virtual environments. It helps keep things nice and clean. It also helps avoid messing up our Python environment.</p>
<h1 id="heading-why-do-we-need-python-virtual-environments">Why do we need Python Virtual Environments?</h1>
<p>We can use Pip to install packages to our Python project. And it is common to have multiple packages installed in a single Python project. This can lead to some issues regarding the versions of the packages installed and their dependencies.</p>
<p>When we use <code>pip install &lt;package name&gt;</code> in a project, we are installing the package and its dependencies in the global Python namespace. And this will install the package for the specific Python version that we have configured Python for. </p>
<p>We can find out where this directory is by using</p>
<pre><code class="lang-shell">python3.7 -c "import sys; print('\n'.join(sys.path))"

/usr/lib/python27.zip
/usr/lib/python2.7
/usr/lib/python2.7/lib-dynload
/usr/lib/python2.7/site-packages
</code></pre>
<p>And if we install the same package using <code>pip3 install &lt;package name&gt;</code>, it will be installed in a separate directory with the Python 3 version. We can overcome this by using the following command:</p>
<pre><code class="lang-shell"> python2.7 -m pip install &lt;package name&gt;
</code></pre>
<p>This still does not solve our problem of packages being installed system-wide, which can lead to the following problems:</p>
<ul>
<li>Different projects having different versions of the same package will conflict with one another</li>
<li>A project’s dependencies can conflict with system-level dependencies which can break the system altogether</li>
<li>Multi-user projects is not a possibility</li>
<li>Testing code against different Python and library versions is a challenging task</li>
</ul>
<p>To avoid those problems, Python developers use Virtual Environments. These virtual environments make use of isolated contexts (directories) for installing packages and dependencies.</p>
<h1 id="heading-how-to-create-a-virtual-environment">How to Create a Virtual Environment</h1>
<p>We need a tool to make use of Python virtual environments. The tool we use to make them is known as <a target="_blank" href="https://docs.python.org/3/library/venv.html">venv</a>. It is built into the standard Python library for Python 3.3+.</p>
<p>If we were using Python 2, we would have had to install it manually. This is one of the few packages that we do want to install globally.</p>
<pre><code class="lang-shell">python2 -m pip install virtualenv
</code></pre>
<p>Note: We will talk more about venv in this post and Python 3 since there are a few differences between it and virtualenv. The commands are a bit different and the tools work differently under the hood.</p>
<p>We will start by making a new directory wherein we want to work with our project.</p>
<pre><code class="lang-shell">mkdir my-python-project &amp;&amp; cd my-python-project
</code></pre>
<p>Then we will create a new virtual environment:</p>
<pre><code class="lang-shell">python3 -m venv virtualenv

# creates a virtual environment called virtualenv, the name can be anything we want
</code></pre>
<p>This will create a directory called virtualenv in the directory that we just created. The directory will contain a bin folder, a lib folder, an include folder, and an environment configuration file. </p>
<p>All these files ensure that all Python code gets executed within the context of the current environment. This helps us achieve isolation from global environments and avoids the problems we discussed earlier.</p>
<p>In order to start using this environment, we need to activate it. Doing so will also change our command prompt to the current context.</p>
<pre><code class="lang-shell">$ source env/bin/activate
(virtualenv) $
</code></pre>
<p>The prompt is also an indicator that the virtual environment is active and Python code executes under that environment.</p>
<p>Inside our environment, system-wide packages are not accessible and any packages installed inside the environment are not available outside.</p>
<p>Only <code>pip</code> and <code>setuptools</code> are installed by default in a virtual environment.</p>
<p>After activating an environment, the path variable gets modified to achieve the concept of virtual environments.</p>
<p>When we are done and want to switch to the global environment, we can exit using the deactivate command:</p>
<pre><code class="lang-shell">(virtualenv) $ deactivate 
$
</code></pre>
<h1 id="heading-how-to-manage-dependencies-across-environments">How to Manage Dependencies Across Environments</h1>
<p>Now that we have our virtual environments setup, we do not want to keep sharing the packages that can be installed using pip. We want to exclude our virtual environment folder, and be able to reproduce our work on a different system. </p>
<p>We can do this by making use of a requirements file in the root directory of our project.</p>
<p>Let us assume that we installed Flask in our virtual environment. After that, if we run <code>pip freeze</code>, it will list the packages that we have installed and their version numbers.</p>
<pre><code class="lang-shell">(virtualenv) $ pip freeze
Flask==1.1.2
</code></pre>
<p>We can write this to a requirements.txt file to upload to Git, or share with other people in any other form.</p>
<pre><code class="lang-shell">(virtualenv) $ pip freeze &gt; requirements.txt
</code></pre>
<p>This command can be used to update the file too.</p>
<p>And then, whenever someone wants to run our project on their computer, all they need to do is:</p>
<pre><code class="lang-shell">$ cd copied-project/
$ python3 -m venv virtualenv/
$ python3 -m pip install -r requirements.txt
</code></pre>
<p>And everything will work as it was on our system. </p>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>Now we can manage Python virtual environments and thus manage dependencies and packages as needed. If you have any questions regarding this, feel free to get in touch.</p>
<p>_You can find other articles of mine _at__ <a target="_blank" href="https://www.wisdomgeek.com/development/web-development/python/managing-python-dependencies-using-virtual-environments/"><em>https://www.wisdomgeek.com</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up a Python Virtual Environment on Ubuntu 20.04 ]]>
                </title>
                <description>
                    <![CDATA[ By Goran Aviani I recently got myself a “new” laptop – a Lenovo x270 (yay)! And once again I needed to set up a Python virtual environment. So of course I Googled for a solution, just to find my previously written article on the same topic! So in thi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-set-up-python-virtual-environment-on-ubuntu-20-04/</link>
                <guid isPermaLink="false">66d45ee1b3016bf139028d3b</guid>
                
                    <category>
                        <![CDATA[ Integrated Development Environment   ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ubuntu ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 12 Jun 2020 14:36:40 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/06/prateek-katyal-6jYnKXVxOjc-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Goran Aviani</p>
<p>I recently got myself a “new” laptop – a Lenovo x270 (yay)! And once again I needed to set up a Python virtual environment. So of course I Googled for a solution, just to find my <a target="_blank" href="https://www.freecodecamp.org/news/virtualenv-with-virtualenvwrapper-on-ubuntu-18-04/">previously written article on the same topic</a>!</p>
<p>So in this article, I'll update the instructions based on my newly acquired knowledge.</p>
<p>And let me tell you, it’s easier than before because we are going to do only two things:</p>
<ul>
<li>Install virtualenvwrapper</li>
<li>Edit the .bashrc file</li>
</ul>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>In this article I will show you how to set up virtualenvwrapper with pip3 (pip for Python 3). We are not going to use Python 2 because <a target="_blank" href="https://www.python.org/doc/sunset-python-2/">it's no longer supported</a>.</p>
<p>To complete this tutorial, you will need a computer with Ubuntu 20.04 installed and an internet connection. Also, some knowledge of the terminal and Vim editor would be useful.</p>
<h2 id="heading-setting-up-a-virtual-environment">Setting up a Virtual Environment</h2>
<p>Now open your terminal in the home directory by right clicking and choosing the option “Open in Terminal”. You can also press the CTRL, ALT, and T keys on your keyboard at the same time to open the Terminal application automatically.</p>
<p>You first need to create a special directory that will hold all of your virtual environments. So go ahead and create a new hidden directory called virtualenv:</p>
<pre><code class="lang-bash">mkdir .virtualenv
</code></pre>
<h2 id="heading-pip3">pip3</h2>
<p>Now you should install pip for Python3:</p>
<pre><code class="lang-bash">sudo apt install python3-pip
</code></pre>
<p>Confirm the pip3 installation:</p>
<pre><code class="lang-bash">pip3 -V
</code></pre>
<h2 id="heading-virtualenvwrapper">virtualenvwrapper</h2>
<p>virtualenvwrapper is a set of extensions for virtualenv. It provides commands like mkvirtualenv, lssitepackages, and especially workon for switching between different virtualenv environments.</p>
<p>Install virtualenvwrapper via pip3:</p>
<pre><code class="lang-bash">pip3 install virtualenvwrapper
</code></pre>
<h2 id="heading-bashrc-file">bashrc file</h2>
<p>We are going to modify your .bashrc file by adding a row that will adjust every new virtual environment to use Python 3. We will point virtual environments to the directory we created above (.virtualenv) and we will also point to the locations of the virtualenv and virtualenvwrapper.</p>
<p>Now open the .bashrc file using the Vim editor:</p>
<pre><code class="lang-bash">vim .bashrc
</code></pre>
<p>If you still haven’t used Vim before or you don’t have it installed on your computer, you should install it now. It is one of the most widely used Linux editors and for good reason.</p>
<pre><code class="lang-bash">sudo apt install vim
</code></pre>
<p>After you've installed Vim open the .bashrc file by typing in the <code>vim .bashrc</code> command in your terminal. Navigate to the bottom of the .bashrc file, press the letter <strong><em>i</em></strong> to enter insert mode in Vim, and add these rows:</p>
<pre><code class="lang-bash"><span class="hljs-comment">#Virtualenvwrapper settings:</span>
<span class="hljs-built_in">export</span> WORKON_HOME=<span class="hljs-variable">$HOME</span>/.virtualenvs
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
. /usr/<span class="hljs-built_in">local</span>/bin/virtualenvwrapper.sh
</code></pre>
<p>After you are done, press the <em><strong>esc</strong></em> key, then type <strong>:<em>wq</em></strong> and press enter. This command will save the file and exit Vim.</p>
<p>Now you need to reload the bashrc script. There are two ways to do it – close and reopen your terminal, or execute this command in the terminal:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> ~/.bashrc
</code></pre>
<p>To create a virtual environment in Python3 and activate it immediately use this command in your terminal:</p>
<pre><code class="lang-bash">mkvirtualenv name_of_your_env
</code></pre>
<p>To deactivate the environment use the deactivate command.</p>
<p>To list all available virtual environments use the command <em>workon</em> or <em>lsvirtualenv</em> (lsvirtualenv will show the same result as workon but in a fancier way) in your terminal:</p>
<pre><code class="lang-bash">workon
</code></pre>
<pre><code class="lang-bash">lsvirtualenv
</code></pre>
<p>To activate one specific environment use workon + name of your environment:</p>
<pre><code class="lang-bash">workon name_of_your_env
</code></pre>
<p>There are several useful command you might need to use someday:</p>
<p><em>Rmvirtualenv</em> will remove a specific virtual environment located in your .virtualenv directory.</p>
<pre><code class="lang-bash">rmvirtualenv name_of_your_env
</code></pre>
<p><em>Cpvirtualenv</em> will copy the existing virtual environment to a new virtual environment and activate it.</p>
<pre><code class="lang-bash">cpvirtualenv old_virtual_env new_virtual_env
</code></pre>
<p>Well done! You have now created your first isolated Python 3 environment.</p>
<p>Thank you for reading! </p>
<p>Check out more articles like this on my <a target="_blank" href="https://www.freecodecamp.org/news/author/goran/">freeCodeCamp profile</a>, <a target="_blank" href="https://medium.com/@goranaviani">Medium profile</a>, and other fun stuff I build on my <a target="_blank" href="https://github.com/GoranAviani">GitHub page</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up Virtualenv with Virtualenvwrapper on Ubuntu 18.04 ]]>
                </title>
                <description>
                    <![CDATA[ By Goran Aviani Let me tell you a story. Recently, I realized that I needed to review how to set up virtualenvwrapper on top of virtualenv in Ubuntu 18.04. I have completed this process several of times on different computers, and every time it seems... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/virtualenv-with-virtualenvwrapper-on-ubuntu-18-04/</link>
                <guid isPermaLink="false">66d45eff4a7504b7409c33e7</guid>
                
                    <category>
                        <![CDATA[ Developer ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Integrated Development Environment   ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ubuntu ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 01 Apr 2020 10:34:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/06/1-aMYnl2Ctt9Y-RZ5bodNF2g.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Goran Aviani</p>
<p>Let me tell you a story. Recently, I realized that I needed to review how to set up virtualenvwrapper on top of virtualenv in Ubuntu 18.04. I have completed this process several of times on different computers, and every time it seems to be just a little bit different than before.</p>
<p>I just got a new laptop and on the way home I read several tutorials on “How to set up virtualenvwrapper on Ubuntu 18.04”. And let me tell you – it seemed really easy because all of those tutorials were pretty straight forward and basically explained how to do these three 3 things:</p>
<ul>
<li>Install virtualenv</li>
<li>Install virtualenvwrapper</li>
<li>Edit .bashrc/.bash_profile or both</li>
</ul>
<p>But even though I read all those tutorials none of them really worked for me.</p>
<p>I had several errors while trying to figure out what went wrong while following the tutorials. </p>
<p>First I got some of “<em>mkvirtualenv: command not found</em>”, then a little of “<em>-bash: /usr/bin/virtualenvwrapper.sh: No such file or directory</em>”, and then a touch of “<em>ERROR: virtualenvwrapper could not find virtualenv in your path</em>”.</p>
<p>After some research I realized that all virtualenvwrapper Ubuntu 18.04 tutorials are copies an old text written before April 2016 (the release date of Ubuntu 16.04).  </p>
<p>I know this because from Ubuntu 16.04 and onward the location of vritualenvwrapper’s pip installation changed from <code>/usr/local/bin/virtualenvwrapper.sh</code> to <code>~/.local/bin/virtualenvwrapper.sh.</code> Note that the local directory is hidden.</p>
<p>So I'll start by writing a tutorial that will show you how to avoid all those issues mentioned above.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>In this article I will show you how to set up virtualenvwrapper with pip3 (pip for Python 3). I chosen this version of pip instead of a Python 2 because Pythons 2's end of life was January 1. 2020.</p>
<blockquote>
<p>Python 2 will retire in… <a target="_blank" href="https://pythonclock.org/">https://pythonclock.org/</a></p>
</blockquote>
<p>To complete this tutorial you will need a computer with Ubuntu 18.04 installed and an internet connection :). Also some knowledge about terminals and the Vim editor would be useful. I will assume you already updated and upgraded your system.</p>
<h2 id="heading-setting-up-a-virtual-environment">Setting up a Virtual Environment</h2>
<p>Now open your terminal in the home directory by right clicking and choosing the option “Open in Terminal”. You can also press the <code>CTRL</code>, <code>ALT</code>, and <code>T</code> keys on your keyboard at the same time to open the Terminal application automatically.</p>
<p>You first need to create a special directory that will hold all of your virtual environments. So proceed with creating a new hidden directory called virtualenv.</p>
<pre><code>mkdir .virtualenv
</code></pre><p>Now you should install pip for Python3.</p>
<pre><code>sudo apt install python3-pip
</code></pre><p>Confirm the pip3 installation.</p>
<pre><code>pip3 --version
</code></pre><p>Now install virtualenv via pip3.</p>
<pre><code>pip3 install virtualenv
</code></pre><p>To find where your virtualenv was installed, type:</p>
<pre><code>which virtualenv
</code></pre><p>Install virtualenvwrapper via pip3:</p>
<pre><code>pip3 install virtualenvwrapper
</code></pre><p>We are going to modify your .bashrc file by adding a row that will adjust every new virtual environment to use Python 3. We will point virtual environments to the directory we created above (.virtualenv) and we will also point to the locations of the virtualenv and virtualenvwrapper.</p>
<p>Now open the .bashrc file using Vim editor.</p>
<pre><code>vim .bashrc
</code></pre><p>If you still haven’t used the Vim editor or you don’t have it installed on your computer you should install it now. It is a widely used Linux editor, and for good reason.</p>
<pre><code>sudo apt install vim
</code></pre><p>After you've installed Vim open the file .bashrc file by typing the <em>vim .bashrc</em> command in your terminal. Navigate to the bottom of the .bashrc file, press the letter <em>i</em> to enter the insert mode of Vim, and add these rows:</p>
<pre><code>#Virtualenvwrapper settings:
<span class="hljs-keyword">export</span> VIRTUALENVWRAPPER_PYTHON=<span class="hljs-regexp">/usr/</span>bin/python3
<span class="hljs-keyword">export</span> WORKON_HOME=$HOME/.virtualenvs
<span class="hljs-keyword">export</span> VIRTUALENVWRAPPER_VIRTUALENV=<span class="hljs-regexp">/home/g</span>oran/.local/bin/virtualenv
source ~<span class="hljs-regexp">/.local/</span>bin/virtualenvwrapper.sh
</code></pre><p>After you are done, press the <em>esc</em> key. Then type <code>:wq</code> and press enter. This command will save and exit the Vim editor. Close and reopen your terminal when you’re done.</p>
<p>To create a virtual environment in Python3 and activate it immediately, use this command in your terminal:</p>
<pre><code>mkvirtualenv name_of_your_env
</code></pre><p>You should confirm that this environment is set up for Python3:</p>
<pre><code>Python -V
</code></pre><p>To deactivate the environment use the deactivate command.</p>
<pre><code>deactivate
</code></pre><p>To list all available virtual environments use the command <em>workon</em> or <em>lsvirtualenv</em> (same result as workon but shown in a fancy way) in your terminal:</p>
<pre><code>workon

lsvirtualenv
</code></pre><p>To activate one specific environment use workon + name of your environment:</p>
<pre><code>workon name_of_your_env
</code></pre><p>There are several useful command you might need to use someday:</p>
<p><em>Rmvirtualenv</em> will remove a specific virtual environment located in your .virtualenv directory.</p>
<pre><code>rmvirtualenv name_of_your_env
</code></pre><p><em>Cpvirtualenv</em> will copy the existing virtual environment to a new virtual environment and activate it.</p>
<pre><code>cpvirtualenv old_virtual_env new_virtual_env
</code></pre><p>Well done! You have now created your first isolated Python 3 environment.</p>
<p>Thank you for reading! Check out more articles like this on <a target="_blank" href="https://www.freecodecamp.org/news/author/goran/">my freeCodeCamp profile</a> and other fun stuff I build on <a target="_blank" href="https://github.com/GoranAviani">my GitHub page</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Python Virtual Environments Explained with Examples ]]>
                </title>
                <description>
                    <![CDATA[ Virtual environments can be described as isolated installation directories. This isolation allows you to localized the installation of your project’s dependencies, without forcing you to install them system-wide. Imagine you have two applications, Ap... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/python-virtual-environments-explained-with-examples/</link>
                <guid isPermaLink="false">66c35d1af83dfae169b2c052</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ toothbrush ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 01 Feb 2020 00:00:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9d12740569d1a4ca35bd.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Virtual environments can be described as isolated installation directories. This isolation allows you to localized the installation of your project’s dependencies, without forcing you to install them system-wide.</p>
<p>Imagine you have two applications, App1 and App2. Both use the package Pak, but require different versions. If you install Pak version 2.3 for App1, you would not be able to run App2 because it requires version 3.1. </p>
<p>This is where virtual environments come in handy.</p>
<p>Benefits:</p>
<ul>
<li>You can have multiple environments, with multiple sets of packages, without conflicts among them. This way, different projects’ requirements can be satisfied at the same time.</li>
<li>You can easily release your project with its own dependent modules.</li>
</ul>
<p>Here are two ways you can create Python virtual environments.</p>
<h2 id="heading-virtualenv"><strong>Virtualenv</strong></h2>
<p><code>[virtualenv](https://virtualenv.pypa.io/en/stable/)</code> is a tool used to create isolated Python environments. It creates a folder which contains all the necessary executables to use the packages that a Python project would need.</p>
<p>You can install it with <code>pip</code>:</p>
<pre><code class="lang-text">pip install virtualenv
</code></pre>
<p>Verify the installation with the following command:</p>
<pre><code class="lang-text">virtualenv --version
</code></pre>
<h3 id="heading-create-an-environment"><strong>Create an Environment</strong></h3>
<p>To create a virtual environment use:</p>
<pre><code class="lang-text">virtualenv --no-site-packages my-env
</code></pre>
<p>This creates a folder in the current directory with the name of the environment (<code>my-env/</code>). This folder contains the directories for installing modules and Python executables.</p>
<p>You can also specify the Python version you want to work with. Just use the argument <code>--python=/path/to/python/version</code>. For instance, <code>python2.7</code>:</p>
<pre><code class="lang-text">virtualenv --python=/usr/bin/python2.7 my-env
</code></pre>
<h3 id="heading-list-environments"><strong>List Environments</strong></h3>
<p>You can list the available environments with:</p>
<pre><code class="lang-text">lsvirtualenv
</code></pre>
<h3 id="heading-activate-an-environment"><strong>Activate an Environment</strong></h3>
<p>Before you can start using the environment you need to activate it:</p>
<pre><code class="lang-text">source my-env/bin/activate
</code></pre>
<p>This ensures that only packages under <code>my-env/</code> are used.</p>
<p>You will notice that the name of the environment is shown on the left of the prompt. This way you can see which is the active environment.</p>
<h3 id="heading-install-packages"><strong>Install Packages</strong></h3>
<p>You can install packages one by one, or by setting a <code>requirements.txt</code> file for your project.</p>
<pre><code class="lang-text">pip install some-package
pip install -r requirements.txt
</code></pre>
<p>If you want to create a <code>requirements.txt</code> file from the already installed packages, run the following command:</p>
<pre><code class="lang-text">pip freeze &gt; requirements.txt
</code></pre>
<p>The file will contain the list of all the packages installed in the current environment, and their respective versions. This will help you release your project with its own dependent modules.</p>
<h3 id="heading-deactivate-an-environment"><strong>Deactivate an Environment</strong></h3>
<p>If you are done working with the virtual environment you can deactivate it with:</p>
<pre><code class="lang-text">deactivate
</code></pre>
<p>This puts you back to the system’s default Python interpreter with all its installed libraries.</p>
<h3 id="heading-delete-an-environment"><strong>Delete an Environment</strong></h3>
<p>Simply delete the environment folder.</p>
<h2 id="heading-conda"><strong>Conda</strong></h2>
<p><a target="_blank" href="https://conda.io/docs/index.html"><code>Conda</code></a> is a package, dependency and environment management for many languages, including Python.</p>
<p>To install Conda, follow these <a target="_blank" href="https://conda.io/docs/user-guide/install/index.html">instructions</a>.</p>
<h3 id="heading-create-an-environment-1"><strong>Create an Environment</strong></h3>
<p>To create a virtual environment use:</p>
<pre><code class="lang-text">conda create --name my-env
</code></pre>
<p>Conda will create the corresponding folder inside the Conda installation directory.</p>
<p>You can also specify which version of Python you want to work with:</p>
<pre><code class="lang-text">conda create --name my-env python=3.6
</code></pre>
<h3 id="heading-list-environments-1"><strong>List Environments</strong></h3>
<p>You can list all the available environments with:</p>
<pre><code class="lang-text">conda info --envs
</code></pre>
<h3 id="heading-activate-an-environment-1"><strong>Activate an Environment</strong></h3>
<p>Before you can start using the environment you need to activate it:</p>
<pre><code class="lang-text">source activate my-env
</code></pre>
<h3 id="heading-install-packages-1"><strong>Install Packages</strong></h3>
<p>The same as with <code>virtualenv</code>.</p>
<h3 id="heading-deactivate-an-environment-1"><strong>Deactivate an Environment</strong></h3>
<p>If you are done working with the virtual environment you can deactivate it with:</p>
<pre><code class="lang-text">source deactivate
</code></pre>
<h3 id="heading-remove-an-environment"><strong>Remove an Environment</strong></h3>
<p>If you want to remove an environment from Conda use:</p>
<pre><code class="lang-text">conda remove --name my-env
</code></pre>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Installing Multiple Python Versions on Windows Using Virtualenv ]]>
                </title>
                <description>
                    <![CDATA[ By Dalya Gartzman You are here because: You are using Windows OS version 10+ You would like to use multiple Python versions on the same computer You are tired of the internet telling you to “Just Use Virtualenv” TL;DR Open Command Prompt and enter... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/installing-multiple-python-versions-on-windows-using-virtualenv/</link>
                <guid isPermaLink="false">66d45e043a8352b6c5a2aa15</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualenv ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows 10 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 15 Jun 2019 09:42:20 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2019/06/download-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Dalya Gartzman</p>
<p>You are here because:</p>
<ol>
<li>You are using Windows OS version 10+</li>
<li>You would like to use multiple Python versions on the same computer</li>
<li>You are tired of the internet telling you to “Just Use Virtualenv”</li>
</ol>
<h3 id="heading-tldr">TL;DR</h3>
<ol>
<li>Open <code>Command Prompt</code> and enter <code>pip install virtualenv</code></li>
<li>Download the desired <code>python</code> version (do NOT add to PATH!), and remember the <code>path\to\new_python.exe</code> of the newly installed version</li>
<li>To create a virtualenv, open <code>Command Prompt</code> and enter<br><code>virtualenv \path\to\env -p path\to\new_python.exe</code></li>
<li>If you are using <code>PyCharm</code>, update the <code>Project Interpreter</code> and the <code>Code compatibility inspection</code>.</li>
<li>To install packages:<br>(I) Activate virtualenv: open <code>Command Prompt</code> and enter <code>path\to\env\Scripts\activate.bat</code><br>(II)  Install desired packages<br>(III)  Deactivate with <code>deactivate</code> .</li>
</ol>
<h3 id="heading-the-long-version-do-read">The Long version; Do Read</h3>
<h4 id="heading-prologue">Prologue</h4>
<p>If you are using the <a target="_blank" href="https://www.anaconda.com/distribution/#download-section">Anaconda App</a> this process might be easier using their GUI. I haven’t tried it myself, please let me know how it went if you are going down that road :)</p>
<h4 id="heading-1-install-virtualenv">1. Install virtualenv</h4>
<p>If you already have some virtual environments, or are using Anaconda, make sure the next steps are performed from <strong>outside</strong> all these environments.</p>
<h4 id="heading-2-install-python">2. Install Python</h4>
<p>You can download python from the <a target="_blank" href="https://www.python.org/">official site</a>, for example for <code>python3.7.3</code> go <a target="_blank" href="https://www.python.org/downloads/release/python-373/">here</a>.</p>
<p>The file you should be downloading is called <code>Windows x86–64 executable installer</code>, or <code>Windows x86 executable installer</code> if for some reason you are using a 32-bit windows.</p>
<p>Once downloading is finished, open the executable file and an installation prompt will appear.</p>
<ul>
<li>You do NOT want to add the new python to your PATH since we are going to have multiple python versions on the same computer, and we would like for each application to know only one python version.</li>
<li>Either use the default suggested location for the new python, or supply a location of your choice. Either way, remember this location and let’s denote it from now on with <code>C:\&lt;some_path&gt;\Python37</code> .</li>
</ul>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*6TY68J0S0Mls0m3fthyaCg.png" alt="Image" width="1000" height="610" loading="lazy"></p>
<h4 id="heading-3-create-a-virtualenv">3. Create a virtualenv</h4>
<p>Open the <code>Command Prompt</code>, or if you are using Anaconda open the <code>Anaconda Prompt</code> .</p>
<p>Decide where you want your virtualenv to be, for example,<br><code>C:\Users\&lt;your_username&gt;\Anaconda3\envs\&lt;env_name&gt;</code> .</p>
<p>Enter:</p>
<p><code>virtualenv C:\Users\&lt;your_username&gt;\Anaconda3\envs\&lt;env_name&gt; -p C:\&lt;some_path&gt;\Python37\python.exe</code></p>
<h4 id="heading-4-update-pycharm-interpreter">4. Update PyCharm Interpreter</h4>
<p>If you are using PyCharm, open the project you would like to work on (that is/will be written with the new python version), and go to <code>File -&gt; Settings -&gt; Project -&gt; Project Interpreter</code> press the gear icon and then <code>Add..</code> .</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/06/image-43.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This will open a prompt window that allows you to define a new interpreter:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*EyUVRuDrL1NtI-6kyAylpw.png" alt="Image" width="1000" height="343" loading="lazy"></p>
<p>Assuming you are using Code Inspections, you might need to tell PyCharm which python version to inspect for. Go to <code>File -&gt; Settings-&gt; Editor -&gt; Inspections -&gt; Python -&gt; Code compatibility Inspection</code> , make sure the box on the top indicates the specific project you are working on, and tick the box of your python version.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*vHL71y1uLNsUGPOEOrFmkQ.png" alt="Image" width="985" height="696" loading="lazy">
<em>If you don’t see your python version on the Options list, this might also be the time to update PyCharm… yup, happened to me too…</em></p>
<h4 id="heading-5-install-packages">5. Install packages</h4>
<p>Currently, your <code>virtualenv</code> contains only the crucial packages, <code>pip</code> and <code>setuptools</code> . To install more packages:</p>
<ol>
<li>Open <code>Command Prompt</code> or <code>Anaconda Prompt</code> , and <strong>activate</strong> your virtualenv by entering<br><code>C:\Users\&lt;your_username&gt;\Anaconda3\envs\&lt;env_name&gt;\activate.bat</code></li>
<li>Use <code>pip</code> to install packages like you usually do.</li>
<li><strong>Deactivate</strong> your virtualenv by entering <code>deactivate</code> .</li>
</ol>
<h3 id="heading-epilogue">Epilogue</h3>
<p>This morning, when I decided to open a new project with a different python version, I thought, “Yeah, I’ll just use a virtualenv”, because the internet said I can “Just do it”.</p>
<p>Well, it’s working now, so no hard feelings dear internet, but seriously, was the “Just” really justified? Does <em>reinstalling-PyCharm-only-because-I-want-to-have-proper-code-inspections</em> fall under the “Just” category??</p>
<p>Anyway, along the way I stumbled upon several helpful guides, but each one took me “just” one step of the way, so I decided to put it all in one place.</p>
<p>I hope my journey helped you with yours, and may we all enjoy happy coding, with as little as IT-friction as possible :D</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/0*vaVbNQubipSg57aI.jpg" alt="Image" width="577" height="433" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
