LoginSignup
0
0

More than 3 years have passed since last update.

pandas_datareaderインストール時のエラー

Posted at

1.この記事について

米国株式の実データを取得するPythonライブラリ「pandasa_datareader」をインストールすると下記のエラーが出力された。

root@2a1627805ea9:/home# pip3 install pandas_datareader
(途中略)

    src/lxml/includes/etree_defs.h:14:10: fatal error: libxml/xmlversion.h: No such file or directory
     #include "libxml/xmlversion.h"
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    Compile failed: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    cc -I/usr/include/libxml2 -c /tmp/xmlXPathInit_w7iprr1.c -o tmp/xmlXPathInit_w7iprr1.o
    /tmp/xmlXPathInit_w7iprr1.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
     main (int argc, char **argv) {
     ^~~~
    cc tmp/xmlXPathInit_w7iprr1.o -lxml2 -o a.out
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6l7hbylz/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ex8h4yqx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6l7hbylz/lxml/



In file included from src/lxml/etree.c:692:0:
    src/lxml/includes/etree_defs.h:14:10: fatal error: libxml/xmlversion.h: No such file or directory
     #include "libxml/xmlversion.h"
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    Compile failed: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitnltnxexy.c -o tmp/xmlXPathInitnltnxexy.o
    /tmp/xmlXPathInitnltnxexy.c:1:10: fatal error: libxml/xpath.h: No such file or directory
     #include "libxml/xpath.h"
              ^~~~~~~~~~~~~~~~
    compilation terminated.
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


対策
libxml2-dev libxslt1-devをインストールする。
libxml2-dev libxslt1-devインストール後、pandas_datareaderが無事にインストールできました。

root@2a1627805ea9:/home# apt-get install libxml2-dev libxslt1-dev
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0