Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you've installed <code>libxml2</code>, then it's possible that it's just not picking up the right version (there's a version installed with OS X by default). In particular, suppose you've installed <code>libxml2</code> to <code>/usr/local</code>. You can check what shared libraries <code>etree.so</code> references:</p> <pre><code>$&gt; otool -L /Library/Python/2.7/site-packages/lxml-3.2.1-py2.7-macosx-10.7-intel.egg/lxml/etree.so /Library/Python/2.7/site-packages/lxml-3.2.1-py2.7-macosx-10.7-intel.egg/lxml/etree.so: /usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.24.0) /usr/local/lib/libexslt.0.dylib (compatibility version 9.0.0, current version 9.17.0) /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.3.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) </code></pre> <p>Checking for that symbol in the system-installed version:</p> <pre><code>$&gt; nm /usr/lib/libxml2.2.dylib | grep ___xmlStructuredErrorContext </code></pre> <p>For me, it's not present in the system-installed library. In the version I installed, however:</p> <pre><code>$&gt; nm /usr/local/lib/libxml2.2.dylib | grep ___xmlStructuredErrorContext 000000000007dec0 T ___xmlStructuredErrorContext </code></pre> <p>To solve this, make sure your install path appears first in <code>DYLD_LIBRARY_PATH</code>:</p> <pre><code>$&gt; export DYLD_LIBRARY_PATH=/usr/local/lib $&gt; python &gt;&gt;&gt; from lxml import etree # Success! </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload