Output for which dbt is returning this

(base) aavesh@localhost ~ % which dbt
/Users/aavesh/opt/anaconda3/bin/dbt

then conda remove , pip uninstall and pip 3 uninstall all are failing

(base) aavesh@localhost ~ % conda remove dbt 
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are missing from the target environment:
  - dbt


(base) aavesh@localhost ~ % pip uninstall dbt
WARNING: Skipping dbt as it is not installed.
(base) aavesh@localhost ~ % pip3 uninstall dbt
WARNING: Skipping dbt as it is not installed.
(base) aavesh@localhost ~ % which dbt
/Users/aavesh/opt/anaconda3/bin/dbt

dbt init is also not working because of the error

(base) aavesh@localhost ~ % dbt init
Error: unknown command "init" for "dbt"
Run 'dbt --help' for usage.
2

There are 2 best solutions below

0
On

Using the below 3 commands and uninstalling conda altogether fixed it for me, it was a bit of hassle but probably the best solution for someone like me who was short on time and never used conda packages anyway.

conda activate
conda init --reverse --all
rm -rf anaconda3
0
On

The outpt from your conda list call:

dbt-core 1.3.1 pypi_0 pypi 
dbt-extractor 0.4.1 pypi_0 pypi 
dbt-postgres 1.3.1 pypi_0 pypi 

shows that you used pip for the original installation, which is also what you need to use for the uninstall. Furthermore, it gives you the correct package name to uninstall:

pip uninstall dbt-core dbt-extractor dbt-postgres