I want to use MEGAHIT (git: https://github.com/voutcn/megahit) to assemble metagenome shotgun sequencing reads (illumina).

I install the package with the command conda install -c bioconda megahit as described in on the github page which yields:

Solving environment: done

## Package Plan ##

  environment location: /home/datura-workstation/miniconda3

  added / updated specs:
    - megahit

The following NEW packages will be INSTALLED:

  megahit            bioconda/linux-64::megahit-1.2.9-h8b12597_0

Proceed ([y]/n)?

Where I click yes and the packages is installed. However, after installation I am not able to use the command megahit as this results in the error: megahit: command not found.

I use Ubuntu 18.04.3 LTS and have installed miniconda3.

I reproduced the installation of megahit on a windows computer with a virtual machine using the same Ubuntu version. On my virtual Ubuntu I CAN use the megahit command.

Could anyone please help me solve this problem? I searched the internet but cannot find a good solution on the issue (also not on the github issue page of this package).

  • $\begingroup$ Why not just install Anaconda3? $\endgroup$
    – M__
    Apr 27, 2020 at 13:26
  • 1
    $\begingroup$ Did you install conda without any custom modifications? Check the bin folder of the miniconda root folder for presence of the executable. If it is there then add the bin to PATH. $\endgroup$
    – user3051
    Apr 27, 2020 at 14:10
  • 1
    $\begingroup$ /home/datura-workstation/miniconda3/bin/megahit ? it should be there $\endgroup$
    – StupidWolf
    Apr 27, 2020 at 16:32
  • $\begingroup$ Did you run make install after building? $\endgroup$ Apr 28, 2020 at 5:35
  • $\begingroup$ @JoseFernandoLopezFernandez Anaconda is a package manager that replaces compilation. Therefore this is not necessary. This must be a PATH or environment problem $\endgroup$
    – user3051
    Apr 28, 2020 at 7:39

1 Answer 1


type conda info --envs. Look at your list of environments. Say it's base that has megahit in it, do conda activate base, then just do megahit.

  • $\begingroup$ even in the base environment, the command megahit is not found. $\endgroup$
    – Robvh
    Apr 28, 2020 at 8:16
  • 1
    $\begingroup$ I re-installed megahit and now when I activate conda activate base, megahit does work. Thank you!! $\endgroup$
    – Robvh
    Apr 28, 2020 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.