This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SRA-toolkit installation: "fastq-dump not found"

Hello, I'm trying to install SRA-toolkit om my Mac (Apple M2).

When I first install it in the terminal the shell manages to find the binary when I write:

which fastq-dump

And I get an output similar to the one in the guide:

/Users/JoeUser/sratoolkit.3.0.0-mac64/bin/fastq-dump

However, when I close my terminal and again write:

which fastq-dump

I get the output:

fastq-dump not found

This is even though I have appended the path to the binary

export PATH=$PATH:$PWD/sratoolkit.3.0.0-mac64/bin

And changed the SRA-toolkit to the one I have downloaded which is 3.0.5.

I cannot figure out why I this error occurs.

All help is appreciated.

Thank you very much.

fastq sra-toolkit

can you type in the full path rather than $PWD?

export PATH=$PATH:$PWD/sratoolkit.3.0.0-mac64/bin

1 answer

You need to either do export PATH=$PATH:/path_to/sratoolkit.3.0.0-mac64/bin each time you start a new terminal or add this line to your shell initialization preference file like .bash_profile (for bash shell). Since you appear to be on macOS you may be using zsh as your default shell. If that is your case then add that line to .zshenv file in your home directory. This would ensure that the PATH is correctly set when you start a new terminal.

This solved my issue, thank you so much. Have a great day.

Hi, I install sratoolkit.3.0.7-mac64 and then I run fastq-dump on sratoolkit.3.0.7-mac64/bin directory. It still says fastq-dump not found. Do you know any possible reason?

Have you tried using full path to the executable? Check above $PATH solution as well.

I added those two lines below into .bash_profile and .zshenv, but it still doesn't work.

export PATH=$PATH:'/Users/sratoolkit.3.0.7-mac64/bin'
export PATH=$PATH:./

The only way to run it is in Users/sratoolkit.3.0.7-mac64/bin and ./fastq-dump

I don't know how to export PATH so I can just run it on home directory.

Don't use the single quotes in your export command around directory path. Also the second line is not required.

Once you make the changes open a new terminal so the changes are read during initialization.

I added PATH to .zshrc and it works now!

Hello! How can you modify the .zshenv file? I cant find it in my home directory. Thanks for your comment! :)

If the file does not exist you can create it

touch ~/.zshenv

then add the PATH to it.

Log in to answer this question.