Failed to import 'pydot'. Please install 'pydot'. For example with 'pip install pydot'.
상황설명-
이 에러는 keras 혹은 의사결정나무(decision tree)에서 그래프를 그릴 때 사용하는 graphviz에 문제가 있을 때 발생합니다. 맥과 같은 linux os에서는 패키지가 깔리지 않았을 때, windows에서는 거의 무조건 발생하는 에러라고 보시면 됩니다. 사실 에러는 pydot자체적인 문제가 '아닙니다.' pip install pydot해도 오류는 해결이 되지 않아요.
해결법-
1) Mac과 같은 linux기반 OS + Anaconda
(prompt)
$ conda install graphviz
[if needed]
(coding tools)
import os os.environ["PATH"] += os.pathsep + '~/opt/anaconda3/lib/site-packages/graphviz'
프롬프트에서 먼저 graphviz를 인스톨 해주시면 문제없이 돌아가는 경우가 많습니다. 그러나 설치한 뒤에도 계속해서 에러가 발생한다면 명시적으로 코드내에서 시스템 환경변수를 등록해주시면 됩니다.
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.
원인
이 에러는 matplotlib 패키지에서 발생하는 에러입니다.
matplotlib에서 사용되는 backend가 제대로 설정되지 못하였기 때문에 발생합니다.
[R/Rstudio] dlookr 패키지 설치 후 Error: package or namespace load failed for ‘dlookr’ 발생 시 대처방안
R studio에서 dlookr 패키지를 설치하게 되면, 가끔씩 버전과 맥OS유무에 따라 Error: package or namespace load failed for ‘dlookr’에러를 뿜는 경우가 있다.
전체 에러는
Error: package or namespace load failed for ‘dlookr’: .onLoad failed in loadNamespace() for 'tcltk', details: call: fun(libname, pkgname) error: X11 library is missing: install XQuartz from xquartz.macosforge.org