{"id":160,"date":"2024-02-19T12:08:33","date_gmt":"2024-02-19T12:08:33","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=160"},"modified":"2024-08-22T07:25:48","modified_gmt":"2024-08-22T07:25:48","slug":"conda-installation-on-ubuntu-simplified-step-by-step-instructions-with-activation-and-deactivation","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/conda-installation-on-ubuntu-simplified-step-by-step-instructions-with-activation-and-deactivation\/","title":{"rendered":"Conda Installation on Ubuntu: Simplified Step-by-Step Instructions with Activation and Deactivation"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction:<\/h2>\n\n\n\n<p>Conda is a powerful package manager for Python and other programming languages, which allows users to easily install and manage packages, environments, and dependencies. If you are an Ubuntu user, installing Conda can help you simplify your development workflow and improve your productivity. In this article, we will provide simplified step-by-step instructions on how to install Conda on<br>Ubuntu, create a new environment, install packages, activate the environment, and deactivate it when needed.\n\n\n\n<p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Installing Conda (&amp; Activating the Environment)<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">a: Create a New Directory<\/h4>\n\n\n\n<p>Open a terminal window on your Ubuntu system. Run the following command to create a new directory:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">mkdir -p ~\/miniconda3<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#mkdir%20-p%20~%2Fminiconda3\">\n                            <button class=\"copy-button\" data-label=\"mkdir -p ~\/miniconda3\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>The <code>-p<\/code> option tells <code>mkdir<\/code> to create the directory if it doesn&#8217;t already exist. The <code>~\/miniconda3<\/code> directory will be used to store the Conda installation files.\n\n\n\n<h4 class=\"wp-block-heading\">b: Download and Install Conda<\/h4>\n\n\n\n<p>Once the new directory is created, run the following command to download and install Conda:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-2\">wget https:\/\/repo.anaconda.com\/miniconda\/Miniconda3-latest-Linux-x86_64.sh -O ~\/miniconda3\/miniconda.sh<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#wget%20https%3A%2F%2Frepo.anaconda.com%2Fminiconda%2FMiniconda3-latest-Linux-x86_64.sh%20-O%20~%2Fminiconda3%2Fminiconda.sh\">\n                            <button class=\"copy-button\" data-label=\"wget https:\/\/repo.anaconda.com\/miniconda\/Miniconda3-latest-Linux-x86_64.sh -O ~\/miniconda3\/miniconda.sh\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command will download the latest version of Miniconda3 for Linux, which is the version of Conda that is recommended for most users.\n\n\n\n<h4 class=\"wp-block-heading\">c: Install Conda<\/h4>\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-3\">bash ~\/miniconda3\/miniconda.sh -b -u -p ~\/miniconda3<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#bash%20~%2Fminiconda3%2Fminiconda.sh%20-b%20-u%20-p%20~%2Fminiconda3\">\n                            <button class=\"copy-button\" data-label=\"bash ~\/miniconda3\/miniconda.sh -b -u -p ~\/miniconda3\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command will start the installation process, which may take a few minutes depending on your system&#8217;s hardware and your internet connection speed.\n\n\n\n<h4 class=\"wp-block-heading\">d: Verify the Installation<\/h4>\n\n\n\n<p>Once the installation is complete, you can verify that Conda has been installed correctly by running the following command in a new terminal:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-4\">conda list<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20list\">\n                            <button class=\"copy-button\" data-label=\"conda list\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>You should see a list of installed packages. Open a new terminal window (changes won\u2019t apply to the current one). If you see a message indicating that Conda is not installed, you may need to reinstall it or check your system&#8217;s PATH<br>environment variable to make sure that it is properly set up.\n\n\n\n<p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Creating a New Environment<\/h3>\n\n\n\n<p>To create a new environment with Conda, follow these steps:\n\n\n\n<p>Open a terminal window on your Ubuntu system.\n\n\n\n<p>Run the following command to create a new environment: \n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-5\">conda create --name myenv<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20create%20--name%20myenv\">\n                            <button class=\"copy-button\" data-label=\"conda create --name myenv\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>Replace &#8220;myenv&#8221; with the name of your choice for the new environment.\n\n\n\n<p>Once the environment is created, you can activate it by running the following command in the terminal: \n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-6\">conda activate myenv<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20activate%20myenv\">\n                            <button class=\"copy-button\" data-label=\"conda activate myenv\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Installing Packages (&amp; Activating the Environment)<\/h3>\n\n\n\n<p>To install packages using Conda, follow these steps:\n\n\n\n<p>Open a terminal window on your Ubuntu system.\n\n\n\n<p>Run the following command to install a package: \n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-7\">conda install package_name<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20install%20package_name\">\n                            <button class=\"copy-button\" data-label=\"conda install package_name\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>Replace &#8220;package_name&#8221; with the name of the package you want to install.\n\n\n\n<p>Once the installation is complete, you can verify that the package has been installed by running the following command in the terminal: \n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-8\">conda list<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20list\">\n                            <button class=\"copy-button\" data-label=\"conda list\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Deactivating the Environment<\/h3>\n\n\n\n<p>To deactivate an environment with Conda, follow these steps:\n\n\n\n<p>Open a terminal window on your Ubuntu system.\n\n\n\n<p>Run the following command to deactivate the current environment: \n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-9\">conda deactivate<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20deactivate\">\n                            <button class=\"copy-button\" data-label=\"conda deactivate\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>Once the environment is deactivated, you can verify that the packages and dependencies installed in that environment are no longer accessible by running the following command in the terminal:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-10\">source ~\/.condarc<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#source%20~%2F.condarc\">\n                            <button class=\"copy-button\" data-label=\"source ~\/.condarc\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<p>1. What is Conda?\n\n\n\n<p>Conda is a package manager for Python and other programming languages, which allows users to easily install and manage packages, environments, and dependencies.\n\n\n\n<p>2. Why do I need Conda on Ubuntu?\n\n\n\n<p>Conda can help you simplify your development workflow and improve your productivity by providing a convenient way to install and manage packages, environments, and dependencies.\n\n\n\n<p>3. Can I use other package managers instead of Conda?\n\n\n\n<p>Yes, there are other package managers available for Ubuntu, such as apt-get, pip, and more. However, Conda is specifically designed for Python and other programming languages, and it provides<br>additional features and functionality that may be useful for some users.\n\n\n\n<p>4. . Do I need to install Conda every time I want to use it?\n\n\n\n<p>No, once you have installed Conda on Ubuntu, you can activate it each time you want to use it by running the <code>source ~\/.condarc<\/code> command in the terminal.\n\n\n\n<p>5. Can I create multiple environments with Conda?\n\n\n\n<p>Yes, you can create as many environments as you need using Conda. Each environment can have its own set of packages and dependencies installed.\n\n\n\n<p>6. How do I activate an environment with Conda?\n\n\n\n<p>To activate an environment with Conda, run the <code>source ~\/.condarc<\/code> command in the terminal. This will set the current directory as the root of the environment, and any packages or dependencies<br>installed in that environment will be accessible from that point on.\n\n\n\n<p>7. Can I use Conda to manage packages for other programming languages than Python?\n\n\n\n<p>Yes, Conda can also be used to manage packages for other programming languages, such as R, Julia, and more.\n\n\n\n<p>8. How do I update packages with Conda?\n\n\n\n<p>To update packages with Conda, run the following command in the terminal: <code>conda update --all<\/code>. This will check for and install any updates for all packages installed using Conda.\n\n\n\n<p>9. Can I use Conda to create a virtual environment?\n\n\n\n<p>Yes, Conda can be used to create a virtual environment by running the <code><strong>conda create --name myenv --python=3.x<\/strong><\/code> command, where &#8220;myenv&#8221; is the name of the environment you want to create and &#8220;3.x&#8221; is the version of Python you want to use for that environment.\n\n\n\n<p>10. How do I remove packages with Conda?\n\n\n\n<p>To remove a package with Conda, run the following command in the terminal: <code>conda remove package_name<\/code>. Replace &#8220;package_name&#8221; with the name of the package you want to remove.\n\n\n\n<p>11. How do i remove a conda environment?\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-11\">conda deactivate\nconda env remove -n myenv<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#conda%20deactivate%0Aconda%20env%20remove%20-n%20myenv\">\n                            <button class=\"copy-button\" data-label=\"conda deactivate\nconda env remove -n myenv\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>The <code><strong>myenv<\/strong><\/code> Conda environment will be removed using the command above\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion:<\/h2>\n\n\n\n<p>In conclusion, installing Conda on Ubuntu is a straightforward process that can help you simplify your development workflow and improve your productivity. By following the step-by-step instructions<br>provided in this article, you can easily create a new environment, install packages, activate the environment, and deactivate it when needed. Give Conda a try today and see how it can benefit your<br>development workflow!\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Conda is a powerful package manager for Python and other programming languages, which allows users to easily install and manage packages, environments, and dependencies. [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":8,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":1032,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions\/1032"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}