Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to access lxml on Mac OS X with Enthought Canopy installed?
    primarykey
    data
    text
    <p>I am new to python and programming in Terminal. I am trying to install and then access lxml but I already installed Canopy, and I don't know how to get to the normal installation directory or how to make sure that Canopy can see the installation. </p> <p>Question: How do you install lxml on Mac OSX?</p> <p>Attempts so far: First, I tried:</p> <pre><code>$ import lxml -bash: import: command not found </code></pre> <p>Showing my complete ignorance, I figured that maybe I need to be in python environment to import it, but that is not the case either:</p> <pre><code>$ python import lxml /Users/user/Library/Enthought/Canopy_32bit/User/Resources/Python.app/Contents/MacOS/Python: can't open file 'import': [Errno 2] No such file or directory </code></pre> <p>On SO, I learned that most folks say that you need to make sure that the underlying libraries are installed. So, I did this:</p> <pre><code>$ apt-get install python-dev libxml2 libxml2-dev libxslt-dev -bash: apt-get: command not found </code></pre> <p>Someone else suggested that you should check the static dependencies. So, I did this:</p> <pre><code>$ python setup.py build --static-deps /Users/user/Library/Enthought/Canopy_32bit/User/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory </code></pre> <p>I found this confusing, and I cannot figure out what to do. I am not sure even how I can check the libxml2 installed because I just run into these errors that nothing exists or the command -get does not work. </p> <p>Background: I need to be able to use python for xml parsing and data analysis. I purchased Wes McKinney's book on Python for Data Analysis, and he suggests using Enthought's EPD (but it is now Canopy). I downloaded Canopy. Then, to do what I need to do (about half way through the book), it has you use lxml. </p> <p>Google searches and reading SO suggest that Mac OSX already comes with libxml2 and libxlst</p> <p>Possible helpful details: My bash profile only contains:</p> <pre><code># Added by Canopy installer on 2013-05-29 source /Users/user/Library/Enthought/Canopy_32bit/User/bin/activate </code></pre> <p>I am running: Max OS X Version 10.7.5</p> <p>I installed XCode and installed "Command Line Tools" </p> <p>Please forgive my ignorance. I've ready every question that I can find related to this on SO and searched. I may be missing something basic. </p> <p>Thanks.</p>
    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.
 

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