[ImportError: Failed to import “pydot” solution in MacOS11.6 (Big Sur) M1 chip]

ImportError: Failed to import “pydot” solution in MacOS11.6 (Big Sur) M1 chip

  • question

     'Failed to import `pydot`. '
    ImportError: Failed to import `pydot`. Please install `pydot`. For example with `pip install pydot`.
    

    insert image description here

  • Try method_1 :

  • This method needs to install apt-get in advance, and you need to pay attention to the location of the installed module when installing. If you are using a virtual environment, the module of the last command should be installed in the default environment of the system. If you have installed apt-get, you can directly enter the following command:

    pip install pydot-ng
    sudo apt-get install graphviz
    
  • Try to install apt-get

  • Use fink to save the country, install apt-get, but goose, my system is Mac os 11.6, which is not supported yet.
    insert image description here

  • final solution

  • Install the following steps and enter the command directly in the terminal, preferably the network is particularly stable and fast:

    /usr/bin/ruby -e "$(curl -fsSL 		https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  • After that, the following error may be reported:

    Error: Fetching /opt/homebrew failed!
    

    insert image description here

  • At this point, continue to enter the following commands in the terminal:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  • Finally, follow the instructions and restart it. Enter the following command in the terminal:

    brew help
    

    insert image description here

  • To install cask, enter the following command in the terminal:

    brew install brew-cask-completion
    

    The final installation result is shown in the figure below:insert image description here

Guess you like

Origin blog.csdn.net/crist_meng/article/details/123904905