How to setup Conda-Forge on macOS (Apple Silicon)

Why Install Conda from Conda-Forge?

Conda is a powerful package manager for Python and other languages, commonly used for data science, machine learning, and software development. While the default Anaconda distribution is popular, the Conda-Forge version provides a lightweight and community-driven alternative.

If you’re using an Apple Silicon Mac (M1/M2), installing Miniforge3 from Conda-Forge ensures better performance and compatibility.

Conda-Forge can use under

Step-by-Step Installation

1. Download Miniforge3 (Conda-Forge Version)

Go to the official website: Conda-Forge Miniforge

Download the installer for macOS (ARM64), which is optimized for Apple Silicon.

2. Install Miniforge3

Once downloaded, open a terminal and run:

bash ~/Downloads/Miniforge3-MacOSX-arm64.sh
bash ~/Downloads/Miniforge3-MacOSX-arm64.sh
bash ~/Downloads/Miniforge3-MacOSX-arm64.sh

Enter fullscreen mode Exit fullscreen mode

Follow the on-screen instructions to complete the installation.

3. Verify Installation

After installation, check if Conda is installed:

/Users/your-username/miniforge3/bin/conda <span>--version</span>
/Users/your-username/miniforge3/bin/conda <span>--version</span>
/Users/your-username/miniforge3/bin/conda --version

Enter fullscreen mode Exit fullscreen mode

(Replace your-username with your actual username.)

If Conda is installed correctly, you should see the version output.

Fix: “Command Not Found” Issue After Installation

If you get a “command not found” error when running conda, follow these steps:

1. Add Conda to PATH

Open your terminal and run:

<span>echo</span> <span>'export PATH="/Users/your-username/miniforge3/bin:$PATH"'</span> <span>>></span> ~/.zshrc
<span>source</span> ~/.zshrc
<span>echo</span> <span>'export PATH="/Users/your-username/miniforge3/bin:$PATH"'</span> <span>>></span> ~/.zshrc
<span>source</span> ~/.zshrc
echo 'export PATH="/Users/your-username/miniforge3/bin:$PATH"' >> ~/.zshrc source ~/.zshrc

Enter fullscreen mode Exit fullscreen mode

If using bash instead of zsh, replace ~/.zshrc with ~/.bashrc.

2. Initialize Conda for Your Shell

Run the following command:

/Users/your-username/miniforge3/bin/conda init zsh
/Users/your-username/miniforge3/bin/conda init zsh
/Users/your-username/miniforge3/bin/conda init zsh

Enter fullscreen mode Exit fullscreen mode

For bash, use:

/Users/your-username/miniforge3/bin/conda init bash
/Users/your-username/miniforge3/bin/conda init bash
/Users/your-username/miniforge3/bin/conda init bash

Enter fullscreen mode Exit fullscreen mode

Then restart your terminal.

3. Test Conda

Try these commands:

conda <span>--version</span>
conda info
conda <span>--version</span>
conda info
conda --version conda info

Enter fullscreen mode Exit fullscreen mode

If they work, your installation is now properly configured!

Conclusion

Using Miniforge3 from Conda-Forge ensures a lightweight, Apple Silicon-optimized Conda installation. If you run into issues with conda not being found, setting the correct PATH and initializing Conda should fix it. Enjoy your Conda-powered development environment on macOS!

原文链接:How to setup Conda-Forge on macOS (Apple Silicon)

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
Nothing can't be figured out. The past just can't be reached again.
没有什么过不去,只是再也回不去
评论 抢沙发

请登录后发表评论

    暂无评论内容