<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://info.stat.cmu.edu/index.php?action=history&amp;feed=atom&amp;title=Python_virtual_environments</id>
	<title>Python virtual environments - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://info.stat.cmu.edu/index.php?action=history&amp;feed=atom&amp;title=Python_virtual_environments"/>
	<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;action=history"/>
	<updated>2026-11-05T06:31:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;diff=836&amp;oldid=prev</id>
		<title>Ajshen at 03:27, 29 June 2026</title>
		<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;diff=836&amp;oldid=prev"/>
		<updated>2026-06-29T03:27:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:27, 29 June 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Containers and Virtual Environments]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Virtual environments are useful tools to manage packages and the associated dependencies. In modern statistical practice, they are also associated with producing reproducible results. Virtual environments also help isolate potentially problematic packages from your “base” environment that can be useful when using certain packages.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Virtual environments are useful tools to manage packages and the associated dependencies. In modern statistical practice, they are also associated with producing reproducible results. Virtual environments also help isolate potentially problematic packages from your “base” environment that can be useful when using certain packages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key infowiki:diff:1.41:old-191:rev-836:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Ajshen</name></author>
	</entry>
	<entry>
		<id>https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;diff=191&amp;oldid=prev</id>
		<title>Ajshen: replace conda with mamba</title>
		<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;diff=191&amp;oldid=prev"/>
		<updated>2025-02-21T03:25:00Z</updated>

		<summary type="html">&lt;p&gt;replace conda with mamba&lt;/p&gt;
&lt;a href=&quot;https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;amp;diff=191&amp;amp;oldid=14&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Ajshen</name></author>
	</entry>
	<entry>
		<id>https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;diff=14&amp;oldid=prev</id>
		<title>Skipper: Created page with &quot; Virtual environments are useful tools to manage packages and the associated dependencies. In modern statistical practice, they are also associated with producing reproducible...&quot;</title>
		<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Python_virtual_environments&amp;diff=14&amp;oldid=prev"/>
		<updated>2024-03-29T23:43:36Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; Virtual environments are useful tools to manage packages and the associated dependencies. In modern statistical practice, they are also associated with producing reproducible...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
Virtual environments are useful tools to manage packages and the associated dependencies. In modern statistical practice, they are also associated with producing reproducible results. Virtual environments also help isolate potentially problematic packages from your “base” environment that can be useful when using certain packages.&lt;br /&gt;
&lt;br /&gt;
Like everything in life nowadays, you have a few options that can help you make virtual environments. We will mention and go through the basics of both, but strongly recommend using &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two options are&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; &lt;br /&gt;
#&amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note that&amp;amp;nbsp;&amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt;&amp;amp;nbsp;is actually a language-agnostic package manager. For example, it can be used to manage both Pyhon and R within the same virtual environment.&amp;amp;nbsp;Interested in R-specific virtual environments? Check&amp;amp;nbsp;[[Renv|virtual environments for R]].&lt;br /&gt;
&lt;br /&gt;
= A note on installing packages =&lt;br /&gt;
&lt;br /&gt;
There are two main ways to install python packages, either through &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install scikit-learn&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda install scikit-learn&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; will provide you with the most up-to-date package and &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; only caries a subset of all of the packages avaiable on &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; (aka from &amp;lt;code&amp;gt;pypi&amp;lt;/code&amp;gt;). A major difference between &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; installation of packages and &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; installation is that &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; doesn’t check the dependence struture of packages (this is required to be done manually), whereas &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; makes sure no dependences are broken. This can become very useful especially if you don’t love constantly debugging. If a package cannot be obtained with &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; will still track packages you install using &amp;lt;code&amp;gt;pip install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
N.B. Altough this is a nice&amp;amp;nbsp;&amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; functionality, it can behave annoingly sometimes. For example, conda retrieves packages from different “repositories” called channels (&amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option when running &amp;lt;code&amp;gt;conda install&amp;lt;/code&amp;gt;). Sometimes using different channels can yield different results and download slightly different versions of the same package, which easily causes inconsistencies in the environment. We strongly suggest to use the same channel within an environment, and only change it if&amp;amp;nbsp;a package is only available from a specific channel.&lt;br /&gt;
&lt;br /&gt;
If a python package is just on a GitHub repository&amp;amp;nbsp;and&amp;amp;nbsp;not on &amp;lt;code&amp;gt;pypi&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt;, then you can download/clone the repository, navigate to the repository and then run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install .&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By adding the option&amp;amp;nbsp;&amp;lt;code&amp;gt;-e&amp;lt;/code&amp;gt; to the command above, the cloned repository is installed in editable mode, which allows you to modify that&amp;amp;nbsp;code locally and immediately use the changes by importing the repository in your code as an installed package. This is particularly useful when you are actively developing a package locally.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; and virtual environments =&lt;br /&gt;
&lt;br /&gt;
As mentioned above, &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; should really be thought of as a general package manager, but can also be used to create virtual environments.&lt;br /&gt;
&lt;br /&gt;
== Installing Conda ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; for your personal computer ===&lt;br /&gt;
&lt;br /&gt;
To install&amp;amp;nbsp;&amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; on your personal computer you can install anaconda or miniconda with an installer (works for Mac, Windows and Linux) or via command line. Anaconda takes up more space and comes with a decent amount of packages installed, whereas miniconda takes up much less space but doesn&amp;#039;t come with packages installed (see [https://conda.io/projects/conda/en/latest/user-guide/install/download.html#anaconda-or-miniconda conda.io] for more commentary on the differences. For either installation, check the hash (a unique identifier of the object) to make sure you&amp;#039;re not installing a bug (see [https://conda.io/projects/conda/en/latest/user-guide/install/download.html#id5 | conda.io] for how to check the hash on different OS). Generally speaking, Anaconda can be useful if you&amp;#039;re&amp;amp;nbsp;new to programming. Miniconda has all the package-manager functionalities but requires you to install every single package in the environments, which is generally better if you want to manage your projects from scratch.&lt;br /&gt;
&lt;br /&gt;
To install miniconda head here: [https://docs.conda.io/en/latest/miniconda.html docs.conda] and anaconda head here: [https://docs.anaconda.com/anaconda/install/index.html docs.anaconda].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; for your server ===&lt;br /&gt;
&lt;br /&gt;
To install &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; on the server you need to use the command line all the way through (you cannot download anything from a webpage. As such, I recommend installing miniconda following these steps (for Linux systems):&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;pre&amp;gt;mkdir -p ~/miniconda3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;rm -rf ~/miniconda3/miniconda.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;pre&amp;gt;~/miniconda3/bin/conda init bash&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar steps can be followed to install miniconda from the terminal on Mac and Windows systems. See&amp;amp;nbsp;this [https://engineeringfordatascience.com/posts/install_miniconda_from_the_command_line/ link].&amp;lt;br/&amp;gt; &amp;#039;&amp;#039;&amp;#039;N.B. for Hydras.&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;For reasons related to how Hydras directory system is setup, you will need an extra step to make sure miniconda is initialized and available every time you log into the server. The steps above populate your&amp;amp;nbsp;&amp;lt;code&amp;gt;.bashrc&amp;lt;/code&amp;gt; file with a small script that initialized conda at log in, but this file is not sourced by Hydras. Instead, you need to create a&amp;amp;nbsp;&amp;lt;code&amp;gt;.profile&amp;lt;/code&amp;gt; file (if it&amp;#039;s not already there) and add&amp;amp;nbsp;the following line to it:&lt;br /&gt;
&amp;lt;pre&amp;gt;source .bashrc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Conda’s virtual environments ==&lt;br /&gt;
&lt;br /&gt;
A good tutorial on how to create a virtual environment with &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; can be found at [https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands conda-io]&lt;br /&gt;
&lt;br /&gt;
In a nutshell:&lt;br /&gt;
&lt;br /&gt;
#To a&amp;amp;nbsp;&amp;#039;&amp;#039;&amp;#039;create new environment&amp;#039;&amp;#039;&amp;#039;&amp;amp;nbsp;with Python installed (note that &amp;lt;code&amp;gt;base&amp;lt;/code&amp;gt; is your standard environment) you should run: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda create -n yourenvname python=x.x&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;where &amp;lt;code&amp;gt;x.x&amp;lt;/code&amp;gt; is the python version you’d like to use. I might suggest starting with 3.11&amp;amp;nbsp;now.&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Then to &amp;#039;&amp;#039;&amp;#039;activate your conda environment&amp;#039;&amp;#039;&amp;#039;, just run: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda activate yourenvname&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;This will probably make your terminal show &amp;lt;code&amp;gt;(yourenvname) ...$&amp;lt;/code&amp;gt;, whereas&amp;amp;nbsp;originally it should have read &amp;lt;code&amp;gt;(base) ...$&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;ol start=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To &amp;#039;&amp;#039;&amp;#039;install packages&amp;#039;&amp;#039;&amp;#039; in your local environment:&amp;lt;br/&amp;gt; After activating (and before deactivating your virtual environment) you can just do &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda activate yourenvname&lt;br /&gt;
conda install [package]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;An alternative to the second line is&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;pip install [package]&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To &amp;#039;&amp;#039;&amp;#039;deactivate&amp;#039;&amp;#039;&amp;#039; your environment: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda deactivate&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To &amp;#039;&amp;#039;&amp;#039;share&amp;#039;&amp;#039;&amp;#039; virtual environments (useful for reproducibility):&amp;lt;br/&amp;gt; To share your virtual environment (with collaborators or yourself on the server) you can make a &amp;lt;code&amp;gt;.yml&amp;lt;/code&amp;gt; file that contains all the information about the packages you are using by first opening up the virtual environment and then running &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; conda env export &amp;gt; environment.yml&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;Then you can share the &amp;lt;code&amp;gt;environment.yml&amp;lt;/code&amp;gt; file to another computer, and with that computer create a copy of the environment via&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;code data-lang=&amp;quot;bash&amp;quot;&amp;gt;conda env create -f environment.yml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More guidance can be found here: [https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#sharing-an-environment conda.io]&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt; virtual environments =&lt;br /&gt;
&lt;br /&gt;
If you’re only using &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; as your package installer you can also get virtual environments using &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt;. These environments require you to specify a specific location for their information to be stored (so often are project dependent). Some good references are [https://docs.python-guide.org/dev/virtualenvs/ docs.python-guide] and [https://realpython.com/python-virtual-environments-a-primer/ realpython].&lt;br /&gt;
&lt;br /&gt;
To start you should download &amp;lt;code&amp;gt;virtualenv&amp;lt;/code&amp;gt; with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install virtualenv&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then to create a new virtual environment and use it, you can follow these basic steps:&lt;br /&gt;
&lt;br /&gt;
#You should select where you’d like to store the information about the virtual environment. &lt;br /&gt;
#To &amp;#039;&amp;#039;&amp;#039;create&amp;#039;&amp;#039;&amp;#039; a new virtual environment, in that folder you can run (right in the terminal): &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;virtualenv yourenvname&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To &amp;#039;&amp;#039;&amp;#039;activate&amp;#039;&amp;#039;&amp;#039; run: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;$ source yourenvname/bin/activate&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;This will probably make your terminal show&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;(yourenvname) ...$&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To &amp;#039;&amp;#039;&amp;#039;deactivate&amp;#039;&amp;#039;&amp;#039;: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;(env) ... $ deactivate&lt;br /&gt;
... $&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skipper</name></author>
	</entry>
</feed>