Note that there are some explanatory texts on larger screens.

plurals
  1. POdo i need 32bit libxml2 for python on snow leopard?
    primarykey
    data
    text
    <p>i'm having a hell of a time installing scrapy on my sl mbp. it requires libxml2, so i set about installing that. installing it from macports doesn't seem to pull down the python binding.</p> <p>installing it from source through scrapy's instructions (<a href="http://doc.scrapy.org/intro/install.html#intro-install-step1" rel="nofollow noreferrer">here</a>) does install the python bindings, but when i run 'python -c "import libxml2"' i get an architecture mismatch:</p> <pre><code>Traceback (most recent call last): File "&lt;string&gt;", line 1, in &lt;module&gt; File "libxml2.py", line 1, in &lt;module&gt; import libxml2mod ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site- packages/libxml2mod.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site- packages/libxml2mod.so: mach-o, but wrong architecture </code></pre> <p>when i explicitly build the libxml2 dlls to be 32bit, that error goes away, but then libxslt won't build because of some other library not being 32 bit. i'm afraid to keep pulling on that string. so the question is - is python 32bit only? am i doing something stupid here?</p> <p><em>edit</em> - this is python 2.6</p> <p><em>edit 2</em> - by popular demand, i'm consolidating @Ned Deily's awesome answer up here. all credit to him, i'm just posting the steps i took based on his response:</p> <p>if you've been screwing around with mac ports, (and haven't installed anything else through them that you need), nuke them. </p> <pre><code>$ sudo rm -r /opt/local </code></pre> <p>add the following to <code>/opt/local/etc/macports/variants.conf</code> to prevent downloading the entire unix library with the next commands</p> <pre><code>+bash_completion +quartz +ssl +no_x11 +no_neon +no_tkinter +universal +libyaml -scientific </code></pre> <p>install the macports version of python</p> <pre><code>$ sudo port install python26 </code></pre> <p>install the pre-reqs for scrapy</p> <pre><code>sudo port install py26-libxml2 py26-twisted py26-openssl py26-simplejson py26-setuptools python_select sudo python_select python26 </code></pre> <p>test that the correct python is selected: run <code>$ which python</code>, which should say something along the lines of '/opt/local/bin/python', and that in its own right should be a link to /opt/local/bin/python2.6. </p> <p>test that the correct architectures are present: run <code>file 'which python'</code> (the single quotes should be backticks, which should spit out (for intel macs running 10.6):</p> <pre><code>/opt/local/bin/python2.6: Mach-O universal binary with 2 architectures /opt/local/bin/python2.6 (for architecture x86_64): Mach-O 64-bit executable x86_64 /opt/local/bin/python2.6 (for architecture i386): Mach-O executable i386 </code></pre> <p>test that libxml installed successfully</p> <pre><code>$ python -c 'import libxml2' </code></pre> <p>if all is well, you should get no output.</p> <p>install scrapy</p> <pre><code>sudo /opt/local/bin/easy_install-2.6 scrapy </code></pre> <p>run through the streets (fully clothed) rejoicing that everything is done. again, thanks to ned for the detailed response.</p>
    singulars
    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.
 

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