error de tiempo de ejecución de lxml: Motivo: Versión de biblioteca incompatible: etree.so requiere la versión 12.0.0 o posterior, pero libxml2.2.dylib proporciona la versión 10.0.0


Tengo un problema desconcertante. He utilizado mac versión 10.9, anaconda 3.4.1, python 2.7.6.

Desarrollo de aplicaciones web con python-amazon-product-api. he superado un obstáculo sobre la instalación de lxml, haciendo referencia a clang error: unknown argumento: '-mno-fused-madd' (error de instalación del paquete python).

Pero ocurrió otro error de tiempo de ejecución. Aquí está la salida de webbrowser.

Exception Type: ImportError
Exception Value:    
dlopen(/Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so, 2): Library not loaded: libxml2.2.dylib
Referenced from: /Users/User_Name/Documents/App_Name/lib/python2.7/site-packages/lxml/etree.so
Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

No estoy seguro de cómo proceder y he buscado aquí y en otros lugares para este error en particular. Cualquier ayuda es muy apreciada!

Author: Community, 2014-04-19

6 answers

Estaba teniendo este mismo problema. Me di cuenta de que durante la instalación de pip para mi aplicación web, lxml estaba intentando lo siguiente:

"Construyendo contra libxml2 / libxslt en el siguiente directorio: / Users/[me]/anaconda / lib"

No estoy 100% seguro de por qué, pero una vez que eliminé el anaconda/bin de la ruta de mi sistema en bash_profile (anaconda lo pega allí al instalar) pude instalar pip lxml correctamente. Después de lo cual debería ser capaz de volver a agregar anaconda / bin a la ruta del sistema sin cuestión.

 10
Author: daroo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-08-21 20:10:01

Esto funcionó para mí:

brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force
 101
Author: jessems,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-24 10:09:28

Si usa conda, fuerce una reinstalación de lxml:

$ conda install -f lxml

Tenga en cuenta que forzar una reinstalación puede tener consecuencias imprevistas.

Primero intenté conda update lxml sin ningún efecto.

Luego intentó conda install lxml también sin ningún efecto (pero eso fue hace un tiempo y ymmv see ver comentario).

 41
Author: bahmait,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-24 13:55:39

Consigo que esto funcione haciendo lo siguiente:

conda install libxml2
 7
Author: dvreed77,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-20 01:51:15

Considere usar un canal alternativo en conda.

$ anaconda search -t conda pyquery
Using anaconda-server api site https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
     Name                      |  Version | Package Types   | Platforms      
     ------------------------- |   ------ | --------------- | ---------------
     CS109/pyquery             |    1.2.9 | conda           | linux-64, win-32, win-64, linux-32, osx-64
                                          : A jquery-like library for python
     asmeurer/pyquery          |    1.2.6 | conda           | osx-64         
                                          : https://github.com/gawel/pyquery
     auto/pyquery              |    1.2.8 | conda           | linux-64, linux-32, osx-64
                                          : https://github.com/gawel/pyquery
     dan_blanchard/pyquery     |    1.2.6 | conda           | linux-64       
                                          : https://github.com/gawel/pyquery
     hargup/pyquery            |          | conda           | None-None, linux-64
                                          : A jquery-like library for python
     meloncholy/pyquery        |    1.2.9 | conda           | linux-64       
                                          : A jquery-like library for python
     mhworth/pyquery           |    1.2.8 | conda           | linux-64, osx-64
                                          : A jquery-like library for python
     nbsantos/pyquery          |    1.2.9 | conda           | osx-64         
                                          : A jquery-like library for python
     pdrops/pyquery            |    1.2.8 | conda           | linux-64, osx-64
                                          : A jquery-like library for python
     ziebel/pyquery            |    1.2.9 | conda           | linux-64       
                                          : A jquery-like library for python
Found 10 packages

Luego, eligiendo un canal, haga:

conda install pyquery -c CS109
 0
Author: jbn,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-11-18 20:45:00

Probé casi todos los enfoques anteriores y fallé. Lo que funcionó para mí fue comentar el

export DYLD_LIBRARY_PATH=/usr/lib

En mi perfil de bash. Esta línea es añadida automáticamente por el instalador de anaconda.

 0
Author: Alex Joseph,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-20 08:44:08