[Solved] MAC terminal Use ‘CONDA activate’ and ‘CONDA install package_ Error reported by name’ Error

In M1 series chips, the MAC uses CONDA to switch the environment in order to directly install various libraries or other operations in the target environment. Otherwise, it is directly installed in the python environment in miniforge 3, rather than the python environment being used.


(if CONDA install package_name reports that the permission is not enough, it may be because sudo bash miniforge 3… SH is used when installing miniforge 3, that is, it is installed with the administrator’s permission) — the author’s machine is installed with sudo bash miniforge 3… Sh. here is only a record of the pit he stepped on. Using sudo CONDA install package_Name can solve the problem.


Problems encountered in configuring Python environment on macbook pro of m1pro chip:

After configuring CONDA’s Python environment, switch the environment to use

conda activate env_name #如  conda activate py39

Errors are reported as follows:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'

Solution:

Input directly at the terminal:

conda init zsh

Exit the Mac’s Zsh shell and restart. Then execute CONDA activate env_ Name.

Note: exit the current environment:

conda deactivate

Read More: