<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Diego A. Carrasco Gubernatis | Personal Website (Posts about conda)</title><link>https://diegocarrasco.com/</link><description></description><atom:link href="https://diegocarrasco.com/categories/conda.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:hi@diegocarrasco.com"&gt;Diego Carrasco G.&lt;/a&gt; </copyright><lastBuildDate>Sat, 11 Apr 2026 08:03:45 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Conda (Miniconda) Cheatsheet: Essential Commands You Should Know</title><link>https://diegocarrasco.com/conda/</link><dc:creator>Diego Carrasco G.</dc:creator><description>&lt;figure&gt;&lt;img src="https://diegocarrasco.com/images/social-images/conda.jpg"&gt;&lt;/figure&gt; &lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#tldr"&gt;TLDR:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#what-is-conda"&gt;What is Conda?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#essential-conda-commands"&gt;Essential Conda Commands:&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#1-installing-conda-miniconda"&gt;1. Installing Conda (Miniconda):&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#2-managing-environments"&gt;2. Managing Environments:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#3-managing-packages"&gt;3. Managing Packages:&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#from-conda"&gt;from Conda:&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#from-conda-repositories"&gt;from conda repositories:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#from-pip"&gt;from Pip:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#4-updating-conda"&gt;4. Updating Conda:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#5-exporting-and-importing-environments"&gt;5. Exporting and Importing Environments:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#6-miscellaneous-commands"&gt;6. Miscellaneous Commands:&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://diegocarrasco.com/conda/#references"&gt;References:&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="tldr"&gt;TLDR:&lt;/h3&gt;
&lt;p&gt;This cheatsheet is a summary of the common commands I use. It serves as a quick reference to the most important 
Conda (Miniconda) commands and as a reminder for myself. &lt;/p&gt;
&lt;h3 id="what-is-conda"&gt;What is Conda?&lt;/h3&gt;
&lt;p&gt;Conda is a package and environment management system, widely used in the Python and data science community. 
It allows you to separate projects into environments and install packages into them, making it easy to manage 
dependencies and avoid conflicts between packages. It also helps to replicate a specific environment in another computer.&lt;/p&gt;
&lt;p&gt;MiniConda is a minimal installer for Conda. It includes only Conda, Python, and a few essential packages, and it's managed thought the terminal.&lt;/p&gt;
&lt;h3 id="essential-conda-commands"&gt;Essential Conda Commands:&lt;/h3&gt;
&lt;h4 id="1-installing-conda-miniconda"&gt;1. Installing Conda (Miniconda):&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Download Miniconda&lt;/strong&gt;: Visit the &lt;a href="https://docs.conda.io/en/latest/miniconda.html"&gt;official Miniconda page&lt;/a&gt; and download the installer for your OS.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install Miniconda&lt;/strong&gt;: Follow the installation instructions provided on the download page. In Linux that means 
  running the following:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;~/miniconda3
wget&lt;span class="w"&gt; &lt;/span&gt;https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh&lt;span class="w"&gt; &lt;/span&gt;-O&lt;span class="w"&gt; &lt;/span&gt;~/miniconda3/miniconda.sh
bash&lt;span class="w"&gt; &lt;/span&gt;~/miniconda3/miniconda.sh&lt;span class="w"&gt; &lt;/span&gt;-b&lt;span class="w"&gt; &lt;/span&gt;-u&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;~/miniconda3
rm&lt;span class="w"&gt; &lt;/span&gt;-rf&lt;span class="w"&gt; &lt;/span&gt;~/miniconda3/miniconda.sh&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# if you don't want to keep the installer&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You need to initialize conda for your shell for it to work:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;~/miniconda3/bin/conda&lt;span class="w"&gt; &lt;/span&gt;init&lt;span class="w"&gt; &lt;/span&gt;bash
~/miniconda3/bin/conda&lt;span class="w"&gt; &lt;/span&gt;init&lt;span class="w"&gt; &lt;/span&gt;zsh
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and restart your terminal or run &lt;code&gt;source ~/.bashrc&lt;/code&gt; or &lt;code&gt;source ~/.zshrc&lt;/code&gt; for the changes to take effect.&lt;/p&gt;
&lt;h4 id="2-managing-environments"&gt;2. Managing Environments:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; an Environment: &lt;code&gt;conda create --name myenv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Activate&lt;/strong&gt; an Environment: &lt;code&gt;conda activate myenv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deactivate&lt;/strong&gt; an Environment: &lt;code&gt;conda deactivate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List&lt;/strong&gt; all Environments: &lt;code&gt;conda env list&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remove&lt;/strong&gt; an Environment: &lt;code&gt;conda env remove --name myenv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clone&lt;/strong&gt; an Environment: &lt;code&gt;conda create --name myclone --clone myenv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create an Environment from a File&lt;/strong&gt;: &lt;code&gt;conda env create -f environment.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Update an Environment from a File&lt;/strong&gt;: &lt;code&gt;conda env update -f environment.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Export an Environment to a File&lt;/strong&gt;: &lt;code&gt;conda env export &amp;gt; environment.yml&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Export an Environment to a File (including Conda itself)&lt;/strong&gt;: &lt;code&gt;conda list --explicit &amp;gt; environment.yml&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create an Environment from a File (including Conda itself)&lt;/strong&gt;: &lt;code&gt;conda create --name myenv --file environment.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Update an Environment from a File (including Conda itself)&lt;/strong&gt;: &lt;code&gt;conda update --name myenv --file environment.yml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="3-managing-packages"&gt;3. Managing Packages:&lt;/h4&gt;
&lt;h5 id="from-conda"&gt;from Conda:&lt;/h5&gt;
&lt;p&gt;this is the main and default repository for conda packages.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Install a Package&lt;/strong&gt;: &lt;code&gt;conda install numpy&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Uninstall a Package&lt;/strong&gt;: &lt;code&gt;conda remove numpy&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List Installed Packages&lt;/strong&gt;: &lt;code&gt;conda list&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Update a Package&lt;/strong&gt;: &lt;code&gt;conda update numpy&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search for a Package&lt;/strong&gt;: &lt;code&gt;conda search numpy&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="from-conda-repositories"&gt;from conda repositories:&lt;/h4&gt;
&lt;p&gt;There are alternative repositories to the default one, such as &lt;code&gt;conda-forge&lt;/code&gt; and &lt;code&gt;bioconda&lt;/code&gt;. You can install packages from these repositories by specifying the channel.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install a Package &lt;strong&gt;from &lt;code&gt;conda-forge&lt;/code&gt;&lt;/strong&gt;: &lt;code&gt;conda install -c conda-forge numpy&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install a Package &lt;strong&gt;from &lt;code&gt;bioconda&lt;/code&gt;&lt;/strong&gt;: &lt;code&gt;conda install -c bioconda numpy&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="from-pip"&gt;from Pip:&lt;/h4&gt;
&lt;p&gt;Some packages are not in conda, so you need to use pip to install them. &lt;code&gt;pip&lt;/code&gt; is the default package manager for Python.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Install Pip&lt;/strong&gt;, if its not installed: &lt;code&gt;conda install pip&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install a Package&lt;/strong&gt;: &lt;code&gt;pip install numpy&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="4-updating-conda"&gt;4. Updating Conda:&lt;/h4&gt;
&lt;p&gt;To update conda itself, you need to update the base environment. This means deactivating the environment you are in and updating the base environment.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Update Conda&lt;/strong&gt;: &lt;code&gt;conda update conda&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="5-exporting-and-importing-environments"&gt;5. Exporting and Importing Environments:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Export Environment&lt;/strong&gt;: &lt;code&gt;conda env export &amp;gt; environment.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create Environment from a File&lt;/strong&gt;: &lt;code&gt;conda env create -f environment.yml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="6-miscellaneous-commands"&gt;6. Miscellaneous Commands:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;List Conda Commands&lt;/strong&gt;: &lt;code&gt;conda --help&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check Conda Version&lt;/strong&gt;: &lt;code&gt;conda --version&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="references"&gt;References:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;[Conda Official Documentation](https://docs.conda.io/projects/conda/en/latest/commands/index.html&lt;/li&gt;
&lt;/ul&gt;</description><category>cheatsheet</category><category>conda</category><category>Environment Management</category><category>miniconda</category><category>python</category><category>terminal</category><guid>conda-cheatsheet-essential-commands-you-should-know</guid><pubDate>Mon, 01 Jan 2024 23:56:43 GMT</pubDate></item></channel></rss>