Search code examples
pythonbashanacondacondaminiconda

How to use Conda in Bash


Specs:

  • I use Python 3.8.10
  • WSL Ubuntu Bash
  • VS Code
  • Project: is Python 3.8.8

I've installed both types:

me@PF2DCSXD:/home/me$ ls
Anaconda3   Miniconda3

Yet, when I type conda:

me@PF2DCSXD:~$ conda
ERROR: The install method you used for conda--probably either `pip install conda`
or `easy_install conda`--is not compatible with using conda as an application.
If your intention is to install conda as a standalone application, currently
supported install methods include the Anaconda installer and the miniconda
installer.  You can download the miniconda installer from
https://conda.io/miniconda.html.

I installed Miniconda using the output link ^.

What am I doing wrong? ;(


Followed all these steps and still nothing

$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
$ bash ~/miniconda.sh -b -p
$ rm ~/miniconda.sh
$ source $HOME/miniconda3/bin/activate
>> bash: /home/me/miniconda3/bin/activate: No such file or directory

Solution

  • you will probably have to add conda to your system´s variable path:

    1. go to your home directory:

      cd

    2. open the .bashrc :

      nano .bashrc

    3. type :

      export PATH="/PathOfYours/miniconda3/bin:$PATH"

    4. safe the .bashrc file

    5. Now try again in the terminal:

      conda --version

    that should do the trick now!

    for more info: https://developers.google.com/earth-engine/guides/python_install-conda#mac_3