Error installing pandas_datareader

1. About this article

When I installed the Python library "pandasa_datareader" that acquires the actual data of US stocks, the following error was output.

python


root@2a1627805ea9:/home# pip3 install pandas_datareader
(Omitted)

    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


Countermeasures Install libxml2-dev libxslt1-dev. After installing libxml2-dev libxslt1-dev, pandas_datareader was successfully installed.

python


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

Recommended Posts

Error installing pandas_datareader
polyfit error when installing matplotlib
[python] Error when installing library ramkan
Error resolution when installing numba on macOS
Installing Python 3.4.3.
Homebrew error
Error when installing a module with Python pip
Summary of error handling methods when installing TensorFlow (2)