Disclamer: I am a newbie to UNIX programming.

I downloaded Anaconda but then realized that I did not need it. I deleted and uninstalled it as fully as I could find out how. It seems that everything to do with Anaconda is gone except that the $PATH variable retains paths to folders which no longer exist.

In the terminal when I type

echo $PATH

It returns


How do I remove the Anaconda path? I know that I have to change the .bash_profile, but where exactly is the file located in Mac OS?

Two additional side questions:

1) is the 'Python.framework' path part of the built in Mac python distribution, or is that related to Anaconda as well?

2) what is the /opt/X11/bin related to in the path?

  • Should be in the home folder /Users/Name/. But may also be called .profile. If you don't see it in finder, you may have to enable seeing hidden files. Commented Aug 22, 2016 at 19:46
  • 1
    And to remove the path export PATH=/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin (I don't know where the ; and the &#‌​47 comes from, I don't see when editing the comment) Commented Aug 22, 2016 at 19:55

3 Answers 3


You can edit bash profile with vi ~/.bash_profile make sure the PATH was not added in ~/.bashrc or to /etc/profile

To remove the PATH you can either remove it from the file where it was added, or simply re export the ones you need export PATH=/here/is/one:/here/is/another

  • What if i cant open my Terminal. Where is the location in that context?
    – djangofan
    Commented Feb 17, 2018 at 22:17
  1. Navigate to your user folder in Finder: /Users/username/

  2. Make hidden files visible (the shortcut is ShiftCmd.)

  3. Right click .bash_profile and Open With... your text editor of choice.

  4. ShiftCmd. one more time in Finder to make hidden files invisible again. (Not required, just a good idea.)


You can find the path in /etc/paths or /Users/username/.bash_profile or /Users/username/.bash_login or /Users/username/.profile.

  • Why would .bash_profile be located in /etc/paths? Also, why ate you referencing files not asked about?
    – Allan
    Commented Jan 20, 2023 at 9:35
  • On my mac (macOS Ventura 13.6), the paths were located in /etc/paths as Bearv5 suggested.
    – Van Vangor
    Commented Nov 14, 2023 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .