How to Successfully Install Anaconda on a Mac (and Actually Get it to Work)

If you aren’t using Zsh and Oh My Zsh, you might be set.

So how do you get this to work the way it’s supposed to if you’ve made changes to your terminal?It’s simple!These are the simple steps for a successful Anaconda installation, even in the face of the dreaded “conda command not found” error message.

Step 1: download AnacondaYou can go here to download Anaconda.

Then scroll down a little to the part that says “Anaconda 2019.

03 for macOS Installer.

”You’ll need to know which version of Python you have, so go to your terminal and typepythonThis shows Python version 3.

7.

3You have a couple of choices for your download.

You can choose the graphical installer, which means that you’ll install Anaconda the same exact way that you’d install any other program.

Or you can choose the command line installer, which means that you’ll go to your terminal and type out (or copy and paste) the commands.

We’re going to do the command line installer, so click that link under your version of Python and your download should start.

Step 2: command line installationAfter your download is complete, head on over to your terminal.

If you have Python 3.

7, you’ll runbash ~/Downloads/Anaconda3-2019.

03-MacOSX-x86_64.

shFor Python 2.

7, runbash ~/Downloads/Anaconda2-2019.

03-MacOSX-x86_64.

pkgKeep in mind that if you didn’t download Anaconda to your downloads folder, you’ll need to change that path.

Review the license agreement and accept it by hitting “Enter” about a million times until you get to the end.

At the end, type “yes” if you want to agree.

(It will prompt you.

It will prompt you repeatedly if you miss it.

)If you’re happy with the location it suggests, hit “Enter.

” You can change locations or cancel the installation by entering CTRL-C.

Pay attention to this location!.It will come in handy if you get the error message.

Now hold still.

Be patient.

This can take a few minutes and you won’t know if anything is happening at first.

You could go and grab a beverage if you want, but be quick because the installer will ask, “Do you wish the installer to initialize Anaconda3 by running conda init?” and you almost certainly want to be there to type “yes” when you’re asked.

“Thank you for installing Anaconda!”When your installation is complete, close your terminal window and open a new one for the changes to take effect.

Want to see if it worked?.In your terminal, type a command likeconda listand see what happens.

If it works, you’ll see something like thisThis is a very useful command if you want to know which packages and versions you have installed in your environment!If that worked, congratulations!!!.You are now ready to start using Anaconda, Jupyter Notebooks, Spyder, and all of the other good stuff.

Time to celebrate!Image by StockSnap from PixabayStep 3: conda command not foundOn the other hand, you might be seeing this:The solution to this problem is actually very simple.

You’ll need to know where your Anaconda binary directory is and what your username is.

If you were paying attention during your installation, you already have this information!.You want the location that you specified during installation.

If not, there’s a very, very good chance that if you simply followed the installation instructions, your directory is /Users/ if you’re on a macOS.

(Or /home/ on Linux or Users on Windows10.

)If you don’t know your username, runecho $USERThen all you need to do is runexport PATH="/Users/myname/anaconda3/bin:$PATH"(Definitely make sure you replace “myname” with your username and change the path to the directory if you need to.

If you look at the line above, /Users/myname/anaconda3 would be replaced by /Users/anneb/anaconda3 from the installation location earlier.

Keep everything else the same.

)If you didn’t install Anaconda3, you’ll need to runexport PATH="/Users/myname/anaconda2/bin:$PATH"for Anaconda2 orexport PATH="/Users/myname/anaconda/bin:$PATH"making sure to change “myname” and the directory location if necessary.

Now try conda list!Congratulations!You did it!!!You successfully installed Anaconda and are now able to run it from your command line!Try typingjupyter notebookand see what happens!GIF via GIPHYAs always, if you do anything amazing with this information, let everyone know about it in the comments below or reach out any time on LinkedIn @annebonnerdata!.. More details

Leave a Reply