[Mac] MacBook installed anaconda, error: -zsh: conda: command not found

background:

  • After installing anaconda on the MacBook, I wanted to conda info -etake a look at the environment, but an error was reported:

insert image description here

understand:

  • The path is not updated and needs to be updated manually

method:

  • Open the configuration file:
    • vim ~/.bash_profile
  • Add a line of path after opening,
    • export PATH="/Users/xinggenyuan/文档/Anaconda/anaconda3/bin:$PATH
  • keep
    • :wq!
  • Reload
    • source ~/.bash_profile

A few places to pay attention to:

  • The use of vim:

    • After opening the configuration file through the vim editor, iit is used to edit and insert text; :wq!it means save and exit;
    • reference link
      • https://blog.csdn.net/zhang_yu_ling/article/details/103777714
  • Find the path of the anaconda installation in your computer:

    • The configuration file is hidden, and when the hidden file is not displayed, it looks like this:
      insert image description here
    • The shortcut key to show hidden files: shift + command + .
      insert image description here
    • Double-click this file, you can see the path of anaconda installation, the file content is as follows:
      insert image description here
    • Copy the content of the shaded part and put it in the file opened by vim;

Completed successfully:

insert image description here

other references

https://blog.csdn.net/BOCS_/article/details/105851924?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-105851924-blog-105056892.pc_relevant_aa_2&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-105851924-blog-105056892.pc_relevant_aa_2&utm_relevant_index=1

Guess you like

Origin blog.csdn.net/weixin_42306148/article/details/127469410