'miniconda installation issue on iMac with Apple M1 chip running macOS Big Sur
I am trying to install Miniconda on my new iMac. I have installed Miniconda on an older macOS system before with no problems, but I am having difficulty with this new computer/system.
The computer is an iMac with the Apple M1 chip running macOS Big Sur (version 11.3).
I downloaded the latest miniconda installer and ran the following code: bash Miniconda3-latest-MacOSX-x86_64.sh
This results in the following warning:
WARNING: Your operating system appears not to be 64-bit, but you are trying to install a 64-bit version of Miniconda3. Are sure you want to continue the installation? [yes|no]
I am not sure why it is saying that I don't have a 64-bit system - my understanding is that starting with macOS Catalina, everything should be 64-bit (but may be I am wrong?).
I searched around on the internet, but didn't find a solution, so thought I would try installing it anyway just to see what happens. It does not complete the install. I followed the prompts, but at some point, you get this:
[/Users/jenniferweinert/miniconda3] >>>
PREFIX=/Users/jenniferweinert/miniconda3
Unpacking payload ...
Miniconda3-latest-MacOSX-x86_64.sh: line 411: /Users/jenniferweinert/miniconda3/conda.exe: Bad CPU type in executable
Miniconda3-latest-MacOSX-x86_64.sh: line 413: /Users/jenniferweinert/miniconda3/conda.exe: Bad CPU type in executable
Most of what I have found about issues with miniconda (or anaconda) and macOS (Catalina or Big Sur) relates to the differences between bash and zsh and the two extra lines of code that you need to activate miniconda/anaconda. But I can't even get to that point because I cannot get Miniconda installed!
I was able to install home-brew and then tried the silent installation. But that ended up at the same point, unable to install due to the bad cpu type in executable.
Someone mentioned to me that this might be due to the M1 chip in this computer, but did not have a work-around or solution to suggest.
If anyone can offer any help with this, I would really appreciate it! Also, if there is any additional information that I should provide in order for you to help, just let me know.
Thank you!
Solution 1:[1]
I encountered the same problem with the downloaded ".bash" script. But the ".pkg" installer worked fine.
Solution 2:[2]
In fact, it is a OS default problem. That problem means that your Mac is not seeing Rosetta at first because you haven't used an application made for Intel chips yet.
To solve the problem, just initialize the .pkg, so that Mac asks you to install Rosetta (Just a one life thing).
https://support.apple.com/en-us/HT211861
Install Rosetta, exit installation from the .pkg and then you can bash Miniconda3-latest-MacOSX-x86_64.sh as usual.
You can also continue the installation with the .pkg installer, but I don't personally like it because it puts it into the /opt/miniconda3 folder by default and it doesn't asks you about the conda init script written into the .zshrc file.
This is important if you want to have both miniconda and miniforge as two separated instances.
https://www.youtube.com/watch?v=w2qlou7n7MA&list=RDCMUCR1-GEpyOPzT2AO4D_eifdw&index=1
Let us hope M1 chip developers keep working hard so that we will only use miniforge in the future to take all the juice from the M1 chip with GPU available!
Solution 3:[3]
Better than installing Miniconda, it is recommended to install ...Miniforge.
Miniforge is a conda implementation from the conda-forge channel,
and you can get installers for several platforms including Apple Silicon on this miniforge github.
Miniforge searches automatically for package wheels which are dedicated to Apple Silicon.
Solution 4:[4]
I ran into the same issue. Make sure you download "Miniconda3 macOS Apple M1 ARM 64-bit bash" instead of "Miniconda3 macOS 64-bit bash" from the installer webpage.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | cdunn2001 |
| Solution 2 | Ankara |
| Solution 3 | Agile Bean |
| Solution 4 | roygbiv |
