matplotlib.finance 모듈을 사용하기 위해 아래와 같이 import를 했더니, No module named라는 Error가 발생한다.



Google을 뒤져서 확인을 해보니, stackoverflow에 다음과 같이 친절하게 설명이 있군~ ㅎㅎ


What this warning tells you is that the finance module will be removed at some point.

At the moment you don't need to worry about this warning. It will only affect you, when you update to a yet to be released version 2.2 of matplotlib, in which case you'll need to change your imports.

If you already want to be compatible with future versions now, you can download the mpl_financemodule from https://github.com/matplotlib/mpl_finance .

After having downloaded the files, you may install in the usual way,

python setup.py install

Alternatively you may try installing through pip,

pip install https://github.com/matplotlib/mpl_finance/archive/master.zip

The reason for this is that the people at matplotlib want to keep their code clean and not maintain a specialized sidepackage like this in the main code. They probably also do not want to maintain the package and spend resources on it, which can be better used in the core developpment.


일단 난 두번째 언급된 pip를 통해 mpl_finance를 install 해야겠다. 그리고 나서 matplotlib.finace 대신에 matplotlib.mpl_finance를 사용해야 한다는 것 ~!!!


먼저 pip install 실행을 위해 윈도우 시작 메뉴에서 Anaconda Proompt (py35)를 실행.



그리고 나서 Prompt 창에 위에 언급된 Pip install 명령어를 아래 그림의 빨간 줄처럼 실시하면, 알아서 쭈~욱 install 과정을 실시한다.



그럼 제대로 동작하는지 확인 하기 위해 아래와 같이 python을 실행해서 import 만 하면...



Error가 발생하지 않는다.

여기까지가 끝...


참고로, PyCharm에서 사용하려면, File --> Setting 을 선택한다.



그리고, Project Interpreter를 선택한 다음, 오른쪽 + 버튼을 누른다.



검색창에 mpl-finance라고 타이핑을 한 후 mpl-finance가 표시되면 선택하고, Install-package를 누르면 된다.



인스톨이 완료가 되었으면, PyCharm 콘솔창으로 가서 하기와 같이 import mpl_finance 명령어를 입력하고 enter를 쳤을때 Error가 발생하지 않으면 성공이다.



- End

+ Recent posts