A quick and painless guide to installing Anaconda correctly and fixing the dreaded “conda command not found” error
You know you need it.
As you’re getting started in data science, machine learning, or artificial intelligence, you’re quickly going to realize that you need to be able to use Anaconda. You might want to use Jupyter Notebooks, Spyder, or another awesome program, but one way or another, you’re going to need this thing to work.
While setting up a computer recently, I remembered how hard it was to get Anaconda to work the first time. The installation itself was no problem! The official guide is clear and comprehensive when it comes to the installation itself. You work through it, follow a few simple steps, and you’re good to go!
At the end, it tells you to verify that your installation was successful by typing a command like “conda list” and you’re done!
Nope.
Conda nope
“Conda” didn’t work the first time I installed it. There’s no handy link sitting there that will tell you what to do. You verify it and then you’re done.
You’re on your own.
There’s nothing more frustrating than not even being able to open the program that you need.
It’s not an easy thing to get started in machine learning and artificial intelligence, and being unable to get the necessary tools correctly installed is just crippling. As you start to understand more of the language and commands that you need to make things work, you’ll find that there are plenty of simple answers out there. But none of them make any sense when it’s all new! Just Googling your questions can be challenging.
I had actually done this to myself.
I work on a MacOS (Mojave, if you’re interested). After spending some time working in the terminal, I had turned it into something that was fast, efficient, and also very nice to look at. You can see everything that I did to make my terminal awesome here, but essentially, it’s running
- iTerm2
- Homebrew
- Zsh
- Oh My Zsh
- a few Oh My Zsh plugins
- Z
- Syntax Highlighting
Little did I know that this would make my Anaconda installation a tiny bit more difficult. One single line of code more difficult, as it turns out, but a million times more challenging for a newbie.
This is the step-by-step installation process with a simple one-line fix that will allow you to “conda” anything you want. Even if you’re using the lovely and amazing Zsh.
What happened?
So here’s the thing: the installation was successful, but there was a tiny problem between Zsh and the way my terminal wanted to talk to Anaconda. This can happen for any number of reasons, but Zsh was the culprit here.
It was incredibly easy to fix! But because I had no idea what I was doing, it took forever to figure out.
No one else should have to go through that.
The fix
The official installation guide is here if you feel like checking it out.
The first time I decided to download Anaconda, I went through the normal graphical Mac installation. It worked fine as an application, but it just wouldn’t work with my terminal.
Unwilling to give up, I uninstalled Anaconda and then tried the command-line installation. That one is great because you can decide during installation that you want your terminal to communicate with Anaconda. You’ll get a prompt during installation that asks, “Do you wish the installer to initialize Anaconda3 by running conda init?”
I’d recommend giving that one a big yes.
Of course, it still didn’t work. It probably would, though, if you didn’t have a tricked out terminal! 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 Anaconda
You 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 type
python
You 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 installation
After your download is complete, head on over to your terminal.
If you have Python 3.7, you’ll run
bash ~/Downloads/Anaconda3-2019.03-MacOSX-x86_64.sh
For Python 2.7, run
bash ~/Downloads/Anaconda2-2019.03-MacOSX-x86_64.sh
Keep 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 like
conda list
and see what happens. If it works, you’ll see something like this
This 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!
Step 3: conda command not found
On the other hand, you might be seeing this:
The solution to this problem is actually very simple.
Troubleshooting step #1:
(I know I already said that, but the Anaconda team reached out and let me know that not refreshing your terminal is the most common reason that people have problems at this point.)
Troubleshooting step #2:
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, run
echo $USER
***Update!!***
I recommended modifying PATH to fix the problem (you can see the original fix below), but the Anaconda team reached out with some incredibly helpful information!
They don’t recommend modifying PATH!
You can read the full comment below, but here is a condensed version of the information that you can find in the comments section from the amazing Michael Sarahan:
“Modifying PATH can cause problems if there are any other programs on your system that have the same names, that Anaconda then hides (shadows) by being found first. What “conda init” does is to set up a conda “shell function” and keep the other stuff off PATH. Nothing but conda is on PATH. It then defaults to activating your base environment at startup. The net effect is very much like your PATH addition, but has some subtle, but critically important differences:
activation ensures that anaconda’s PATH stuff is right up front. Putting anaconda at the front of PATH permanently is good in that it prevents confusion, but bad in that it shadows other stuff and can break things. Activation is a less permanent way to do this. You can turn off the automatic activation of the base environment using the “auto_activate_base” condarc setting.
activation does a bit more than just modifying PATH. It also sources any activate.d scripts, which may set additional environment variables. Some things, such as GDAL, require these. These packages will not work without activation.
So, rather than your tip on modifying PATH, what we recommend is following the directions at the end of the installer, should you choose not to run conda init:
…
that will look like 2 commands:
1. eval “$(/home/msarahan/mc3_dummy/bin/conda shell.bash hook)”
2. conda init
Note that in step 1, I changed the shell name from YOUR_SHELL_NAME to bash. You may need to adjust that yourself to your shell.”
Long story short, it’s entirely possible that modifying PATH might cause you some problems down the road. It’s smarter to go with activation because it isn’t permanent and will allow some packages to run that might not otherwise.
So, at the end of the installer, instead of running the original solution:
export PATH="/Users/myname/anaconda2/bin:$PATH"
You want to run
eval "$(/home/msarahan/mc3_dummy/bin/conda shell.bash hook)”
conda init
(But make sure you change the directory location and shell to your own!)
***End of update***
Original solution:
All you need to do to make things work is run
export PATH="/Users/myname/anaconda3/bin:$PATH"
and you’re good to go!!!
(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 would need to run
export PATH="/Users/myname/anaconda2/bin:$PATH"
for Anaconda2 or
export 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 typing
jupyter notebook
and see what happens!
Thanks for reading! If you want to reach out or find more cool articles, please come and join me at Content Simplicity!
Want to learn about the easiest way to create, run, publish, and even share Jupyter Notebooks?
Thanks for reading!
FAQs
What is the best way to install Anaconda? ›
- Go to the Anaconda Website and choose a Python 3. ...
- Locate your download and double click it. ...
- Read the license agreement and click on I Agree.
- Click on Next.
- Note your installation location and then click Next.
- This is an important part of the installation process. ...
- Click on Next.
- Download the installer: Miniconda installer for macOS. ...
- Verify your installer hashes.
- Install: Miniconda---In your terminal window, run: ...
- Follow the prompts on the installer screens. ...
- To make the changes take effect, close and then re-open your terminal window.
- Test your installation.
What is the default path for installing Anaconda? If you accept the default option to install Anaconda on the “default path” Anaconda is installed in your user home directory: Windows 10: C:\Users\<your-username>\Anaconda3\ macOS: /Users/<your-username>/anaconda3 for the shell install, ~/opt for the graphical install.
How much RAM does an Anaconda need? ›You need a minimum RAM size of 32 GB, or 16 GB RAM with 1600 MHz DDR3.
Is it better to install Anaconda or Python? ›Since ActiveState provides commercial support, ActivePython is the best choice for those focused on building commercial applications. Anaconda is a good choice for those focused on creating non-commercial data science applications since you can take advantage of Anaconda's proven Python ecosystem for free.
How do I install Anaconda on my Macbook Pro? ›Installation using Graphical Interface
Step 1: Download the Graphical installer from here and save it inside a directory. Step 5: Click on Continue after reading the License Agreement. Step 6: After Clicking on continue, click on Agree to accept the license agreement. Step 8: Click on Install to start the installation.
conda is a virtual environment manager, a software that allows you to create, removing or packaging virtual environments as well as installing software, while Anaconda (and Miniconda) includes conda along with some pre-downloaded libraries.
Why is Anaconda Navigator not opening on Mac? ›Navigator error on start up
This is often the result of a corrupted . condarc file. To resolve, delete the . condarc file and restart Navigator.
This tutorial will demonstrate how you can install Anaconda, a powerful package manager, on your Mac. Anaconda is a package manager, an environment manager, and Python distribution that contains a collection of many open source packages.
Is Anaconda good for Mac M1? ›All packages included in the installer have been compiled to support ARM64, meaning M1 users can now enjoy the computing efficiency of M1s and speed up workflows by 20%.
What is the best way to install Python on Mac? ›
To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac. If it doesn't, click the macOS link and choose the latest Python release.
What is the latest version of Anaconda for Mac? ›Oct 18, 2022
The 2022.10 release of Anaconda Distribution features Qt support in Anaconda Navigator v2. 3.1, full GUI support for macOS M1's ARM64 architecture, Python 3.10, improved security protocols, and several package updates. 2022.10 is the last release that will support Python 3.7.
Green anacondas are the heaviest snakes in the world. The heaviest anaconda ever recorded was 227 kilograms. This massive snake was 8.43 metres long, with a girth of 1.11 metres. While the reticulated python is longer, it's also slender.
Is 8GB RAM enough for anaconda? ›Yes, Anaconda can run over 4 GB of RAM but sometimes you feel like it's lag and takes time to open your exe like Spyder, Jupyter Notebook. But once it starts then it's working fine. But it's good to have 8GB of RAM to work with Anaconda but it also works fine in 4GB of RAM. Can I use 6GB RAM together with 4GB RAM?
Do I need to install Python before anaconda? ›The answer for you will be No. if you already had anaconda installed in your laptop, once you open it up you will realized you can install Python within the software. Anaconda will not only included Python, R also will be included. Spider or Jupiter notebook can be used for edit your Python scripts.
Is there anything better than Anaconda? ›Python, PyCharm, pip, Jupyter, and Pandas are the most popular alternatives and competitors to Anaconda.
Should I install conda or Anaconda? ›Conda is a package manager. It helps you take care of your different packages by handling installing, updating and removing them. Anaconda contains all of the most common packages (tools) a data scientist needs and can be considered the hardware store of data science tools.
Should I use PyCharm or Anaconda? ›Though they are independent tools, PyCharm and AnaConda can be used together for projects that can benefit from both tools. PyCharm is an IDE built to make it easier to write Python code, by providing a text editor and debugging, among other features. Anaconda is a Python distribution focused on data driven projects.
How much space does Anaconda take on Mac? ›Hardware requirements
(600 GB for air-gapped deployments.) Additional space recommended if the repository will be used to store packages built by the customer. With an empty repository, a base install requires 2 GB.
To see whether Anaconda is installed on your Mac operating system, simply visit the Mac terminal and type Conda info. If Anaconda is installed you will see detailed information for both the Anaconda distribution and Python version.
How do you run an Anaconda Jupyter notebook on a Mac? ›
To launch Jupyter Notebook App: Click on spotlight, type terminal to open a terminal window. Enter the startup folder by typing cd /some_folder_name . Type jupyter notebook to launch the Jupyter Notebook App The notebook interface will appear in a new browser window or tab.
Should I pip or conda install? ›It's fully recommended to use pip inside of conda. It's better to install using conda, but for any packages that don't have a conda build, it's perfectly acceptable to use pip.
Is Anaconda the same as Python programming? ›Anaconda is a distribution of the Python and R programming languages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.), that aims to simplify package management and deployment.
Which is better conda or pip? ›The fundamental difference between pip and Conda packaging is what they put in packages. Pip packages are Python libraries like NumPy or matplotlib . Conda packages include Python libraries (NumPy or matplotlib ), C libraries ( libjpeg ), and executables (like C compilers, and even the Python interpreter itself).
Why is Python not working on my Mac? ›In macOS 12.3 beta Apple removed support for Python 2. Additionally Python 3 no longer comes bundled with macOS. This causes the code command to not work anymore.
Can not install Anaconda on Mac? ›- If Anaconda is running, make sure to quit out of it first. ...
- In the Applications folder, locate the Anaconda icon. ...
- Delete the anaconda3 folder and its contents. ...
- In Finder, click Go > Go to Folder.
- Type ~/Library/Receipts, and press Enter.
- Find and move to trash all Anaconda-related files:
Jupyter fails to start
If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command jupyter notebook . If it can't find jupyter , you may need to configure your PATH environment variable.
A current “universal binary” build of Python, which runs natively on the Mac's new Intel and legacy PPC CPU's, is available there. What you get after installing is a number of things: A Python 3.12 folder in your Applications folder.
Is Anaconda no longer free? ›...
ActiveState vs Anaconda.
The increased performance and efficiency of memory use on the M1 chips suggest that you can get away with the same amount or even less than you have now while still enjoying improved performance. We recommended 16 GB as the minimum for Intel-based Macs, but 8 GB seems to be an acceptable base level for M1-based Macs.
Is 8 GB RAM good for M1 Mac? ›
Yes. Programmers who compile large amounts of code or perform 3D rendering might want to opt for 16GB of memory, but except for these use cases, 8GB on the M1 MacBook Pro is enough.
Are Macbooks good for data science? ›Luckily, the downward trend is over and with the new 2021-edition 14″ Macbook Pro all the issues were fixed and we got a very, very reliable, user-friendly and powerful computer to work with. With that said: any MacBook is a perfect choice for a data scientist.
Which Python is best for Mac? ›- Comparison Table.
- #1) PyScripter.
- #2) PyCharm.
- #3) Spyder.
- #4) Pydev.
- #5) Idle.
- #6) Wing.
- #7) Eric Python.
Luckily for us, the Mac is a great coding platform, and Python makes it easy to learn how to code on a Mac. In this feature, we're going to look at setting up Python in macOS, then learning to code on this platform. The learning curve is very manageable; Python may even be installed on your Mac already.
Does Python run better on Mac or Windows? ›I think your question was: Which is better for Python development, Mac or Windows? Use whichever you got. Both will work just fine. If you have unlimited budget, MacOS is built on Next Unix, so it is built on Unix.
Which Python version is best for Anaconda? ›Anaconda supports Python 3.7, 3.8, 3.9 and 3.10. The current default is Python 3.9.
Is Anaconda 32 bit or 64 bit? ›There is only one version of the installer: the 64-bit version. Contiuum does not offer a 32-bit installer for Macintosh, since Macs post-2011 are 64-bit only (and post-2007 are 64-bit compatible). Linux Operating Systems: Scroll to the "Anaconda for Linux" section.
What is the strongest python in the world? ›African Rock Python
A snake that is strong enough to capture and eat a 150 pound hyena has to be one of the strongest snakes in the world. National Geographic was there to video tape this amazing feat.
Considering the known maximum prey size, a full-grown reticulated python can open its jaws wide enough to swallow a human, but the width of the shoulders of some adult Homo sapiens can pose a problem for even a snake with sufficient size.
Is 8GB RAM overkill? ›8GB of RAM is the sweet spot for the majority of users, providing enough RAM for virtually all productivity tasks and less demanding games. If you're running demanding applications like video editing and CAD, or you're a hardcore gamer, then we recommend that you start at 16GB and go up from there.
How much RAM is needed to run Python? ›
RAM. Any laptop for Python Programming should have at least 8 GB of RAM. But I recommend getting at least 16 GB of RAM if you can afford it. Because, the bigger the RAM, the faster the operations.
Is Python RAM Heavy? ›Those numbers can easily fit in a 64-bit integer, so one would hope Python would store those million integers in no more than ~8MB: a million 8-byte objects. In fact, Python uses more like 35MB of RAM to store these numbers. Why? Because Python integers are objects, and objects have a lot of memory overhead.
What should I do after installing Anaconda? ›After the installation of Anaconda is complete, you can go to the Windows start menu and select the Anaconda Prompt. This opens the Anaconda Prompt. Anaconda is the Python distribution and the Anaconda Prompt is a command line shell (a program where you type in commands instead of using a mouse).
How do I run Python after installing Anaconda? ›Click Start All Programs Anaconda (64-bit) Anaconda Command Prompt. A command prompt window will open. Type idle to run the Python interpreter. A new window titled Python Shell will open and you will see the Python >>> command prompt.
Should I use conda install or pip install? ›It's fully recommended to use pip inside of conda. It's better to install using conda, but for any packages that don't have a conda build, it's perfectly acceptable to use pip.
Which version of Anaconda should I install? ›Installing Anaconda
Choose the Python 3.5 version, you can install Python 2 versions later. Also, choose the 64-bit installer if you have a 64-bit operating system, otherwise go with the 32-bit installer. Go ahead and choose the appropriate version, then install it. Continue on afterward!
The answer for you will be No. if you already had anaconda installed in your laptop, once you open it up you will realized you can install Python within the software. Anaconda will not only included Python, R also will be included. Spider or Jupiter notebook can be used for edit your Python scripts.
Where should I install Anaconda on Windows? ›To find where Anaconda was installed I used the "where" command on the command line in Windows. The where command is a nifty trick. My installation is at C:\Users\User-Name\Anaconda3\Scripts\anaconda.exe .
Which is better pip or Anaconda? ›If you're a beginner in data science, use Anaconda; if you're more experienced with the command line and cannot find packages for your project (that can be outside the data science domain), then go for Python's pip and PyPi. Now let's discuss the differences between Anaconda and Miniconda.
What is the difference between conda and Anaconda? ›Conda is a package manager. It helps you take care of your different packages by handling installing, updating and removing them. Anaconda contains all of the most common packages (tools) a data scientist needs and can be considered the hardware store of data science tools.
Whats the difference between conda and pip? ›
The fundamental difference between pip and Conda packaging is what they put in packages. Pip packages are Python libraries like NumPy or matplotlib . Conda packages include Python libraries (NumPy or matplotlib ), C libraries ( libjpeg ), and executables (like C compilers, and even the Python interpreter itself).
What is difference between Anaconda and Jupyter? ›Anaconda is a Python distribution with many software tools in it. Spyder is an IDE and Jupyter Notebook is a web-based program to code Python for scientific purposes in Anaconda. PyCharm is a popular Python IDE for general purposes.
What is the difference between Anaconda 2 and Anaconda 3? ›Anaconda2 includes Python 2.7 and Anaconda3 includes Python 3.7. However, it does not matter which one you download, because you can create new environments that include any version of Python packaged with conda.
What's the difference between a Python and an Anaconda? ›The anaconda is shorter, thicker, and heavier than the python, but they are both ambush predators that constrict their enemies. There are other more subtle differences, such as how the anaconda's eye placement is slightly higher on its head to allow it to skim the water while swimming.
Does Anaconda need Internet for installation? ›Anaconda Enterprise 4 Repository Requirements
With an empty repository, a base install requires 2 GB. Internet access to download the files from Anaconda.org or a USB drive containing all of the files you need with alternate instructions for air gapped installations.