M HYPE SPLASH
// news

Python path issue with dirname: command not found and conda environment python not found

By Emma Payne

I am running MacOS Catalina (10.15). It is now giving me multiple issues with bash. It gives me the following two errors. Are they related, and if so, how would I fix them?

(base) dhcp-10-105-176-29:cpotts-swda adamg$ conda activate swda
-bash: dirname: command not found
-bash: dirname: command not found
(swda) dhcp-10-105-176-29:cpotts-swda adamg$ echo $PATH
/bin:/bin:/Users/adamg/anaconda3/envs/swda/bin:/bin:/Users/adamg/Library/Python/3.7/bin
(swda) dhcp-10-105-176-29:cpotts-swda adamg$ python
-bash: python: command not found

1 Answer

Bash can't find the commands (dirname and python) because your $PATH variable is not setup properly.

Add this line to the end of your ~/.bash_profile:

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:$PATH

From GNU bash documentation:

PATH
A colon-separated list of directories in which the shell looks for commands. 
8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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