Background: Learning deep learning, using anaconda, creating a virtual environment, and encountered missing packages during learning
was trying to use
keras.utils.plot_model(model, "./lenet-5.png", show_shapes=True)
Then report an error
The problem was found and what measures were taken:
Tiankeng -- the pip install I considered first
Soon, it will be installed, and these packages can also be found using pip list in jupyter
However, still reporting an error
(I found a problem that I used conda list and pip list to list at this time. There is no graphviz in conda list, but there is in pip)
After I tried to uninstall, I installed it directly in jupyter with pip (just add an exclamation point)
!pip install pydot
!pip install graphviz
Still not working, same pop-up error
I followed what other bloggers said, downloaded it from the graphviz official website, and then configured the environment. . .
But it's still the same error
Solution:
Configure the mirror source for conda (configuring the mirror source is still very important, otherwise the download fails or other problems)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/
cloud/pytorch/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
————————————————
then use conda install and wait
Noticed an interesting thing:
I use pip install graphviz only about 70KB
My official website download graphviz has 4.5MB
I have 29.4MB with conda install graphviz
The following packages will be downloaded:
package | build
---------------------------|-----------------
graphviz-2.38 | hfd603c8_2 29.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pydot-1.4.2 | py39hcbf5309_1 43 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyparsing-3.0.7 | pyhd8ed1ab_0 79 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
Total: 29.4 MB
The following NEW packages will be INSTALLED:
graphviz anaconda/pkgs/main/win-64::graphviz-2.38-hfd603c8_2
pydot anaconda/cloud/conda-forge/win-64::pydot-1.4.2-py39hcbf5309_1
pyparsing anaconda/cloud/conda-forge/noarch::pyparsing-3.0.7-pyhd8ed1ab_0
I also encountered this problem when I lacked the seaborn package when I was studying before, and the solution is similar to
the original link: https://blog.csdn.net/TTritium/article/details/122587186
My personal suggestion is to use conda install first (but it must be equipped with a mirror source)