Fwd: installing lxml ? - todays user experience from python-list@python.org
-------- Original Message -------- Subject: installing lxml ? Date: Wed, 11 Nov 2009 04:49:48 -0800 (PST) From: 7stud <bbxx789_05ss@yahoo.com> To: python-list@python.org I'm trying to install lxml, but I can't figure out the installation instructions. Here: http://codespeak.net/lxml/installation.html it says: 1) Get the easy_install tool. Ok, I went to the easy_install website, downloaded, and installed it. The last two lines of the output during installation said this: Installing easy_install script to /Library/Frameworks/Python.framework/ Versions/2.6/bin Installing easy_install-2.6 script to /Library/Frameworks/ Python.framework/Versions/2.6/bin 2) ...run the following as super-user (or administrator): easy_install lxml On MS Windows, the above will install the binary builds that we provide. If there is no binary build of the latest release yet, please search PyPI for the last release that has them and pass that version to easy_install like this: easy_install lxml==2.2.2 On Linux (and most other well-behaved operating systems), easy_install will manage to build the source distribution as long as libxml2 and libxslt are properly installed, including development packages, i.e. header files, etc. Use your package management tool to look for packages like libxml2-dev or libxslt-devel if the build fails, and make sure they are installed. On MacOS-X, use the following to build the source distribution, and make sure you have a working Internet connection, as this will download libxml2 and libxslt in order to build them: STATIC_DEPS=true easy_install lxml ----------- My os is mac os x 10.4.11. But this: STATIC_DEPS=true easy_install lxml is not a valid command: $ sudo STATIC_DEPS=true easy_install lxml Password: sudo: STATIC_DEPS=true: command not found In any case, if I do this: $ sudo easy_install lxml sudo: easy_install: command not found In other words, when I installed easy_install it did not add anything to my PATH which points to the installation directory mentioned during installation: Installing easy_install script to /Library/Frameworks/Python.framework/ Versions/2.6/bin Ok, so I need to use the full path to the easy_install program (which is not mentioned ANYWHERE in the installation instructions), i.e. /Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install ...but this still isn't going to work: $ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/ 2.6/bin/easy_install lxml Password: sudo: STATIC_DEPS=true: command not found So what the heck is going on?? Attention developers: you may be one of the best programmers in the world, but if you can't convey how to use your software to the average user, then you are the equivalent of one of the worst programmers on the planet. -- http://mail.python.org/mailman/listinfo/python-list
David Lyon, on 2009-11-11:
$ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/ 2.6/bin/easy_install lxml Password: sudo: STATIC_DEPS=true: command not found
On linux 'true' is a command: $ whatis true true (1) - do nothing, successfully Apparently that is not available on Mac OS X. Can you try with STATIC_DEPS=1 ? (Note that I have no Mac experience.) -- Maurits van Rees | http://maurits.vanrees.org/ Work | http://zestsoftware.nl/ "This is your day, don't let them take it away." [Barlow Girl]
On Wed, Nov 11, 2009 at 11:10 PM, Maurits van Rees <m.van.rees@zestsoftware.nl> wrote:
David Lyon, on 2009-11-11:
$ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/ 2.6/bin/easy_install lxml Password: sudo: STATIC_DEPS=true: command not found
On linux 'true' is a command: $ whatis true true (1) - do nothing, successfully
I would advise against using sudo easy_install. This will cause trouble by mixing the system python and the softwares it expects vs. custom ones. If it were me, I would even raises an exception in easy_install if run under root without any prefix option. That's an ever-ending source of trouble. Most of the OP problems have nothing to do with easy_install or even python, but with sudo. sudo does not propagate env variables (more exactly, it has strict rules about which variables to reuse). Do not use sudo, and your problem will disappear. On python 2.6, a good way to avoid sudo is to use --local to install things in $HOME/.local (I don't know how to do that from easy_install --local is an install option to distutils). Otherwise, install things in a directory which is in your PYTHONPATH. I for example use $HOME/local on mac os x, and install everything there for python < 2.6. David
On Wed, Nov 11, 2009 at 02:10:59PM +0000, Maurits van Rees wrote:
David Lyon, on 2009-11-11:
$ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/ 2.6/bin/easy_install lxml Password: sudo: STATIC_DEPS=true: command not found
On linux 'true' is a command:
That's not the issue. The point of STATIC_DEPS=true is to set an environment variable in the environment that easy_install is running in. So the problem here is not knowing how to invoke sudo (something like "ENV=val sudo -E cmd" would do the job on top of my head, not sure though - just "sudo -i" and then you have a normal root shell though). But that doesn't seem to be the point of this email here. If you want to help out with that you should probably find the thread on python-list and participate there. Regards Floris
On 2009-11-11, Maurits van Rees <m.van.rees@zestsoftware.nl> wrote:
David Lyon, on 2009-11-11:
$ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/ 2.6/bin/easy_install lxml Password: sudo: STATIC_DEPS=true: command not found
On linux 'true' is a command: $ whatis true true (1) - do nothing, successfully
Apparently that is not available on Mac OS X.
The problem is that sudo expects a command. "STATIC_DEPS=true" is not a command. An "export STATIC_DEPS=true ought to be ok. Building lxml is historically quite a pain on osx. It keeps improving though. The most sure-fire way of getting it to run is to use buildout in combination with the staticlxml recipe at http://pypi.python.org/pypi/z3c.recipe.staticlxml I haven't seen a problem report about that in the last 6 months :-) I agree with the sentiment of the original email that the initial impression is, shall we say, sub-obtimal. For me, this is one of the strong points of buildout: once you buy into the general idea, it solves a whopping load of problems for you. Isolation, installation, setup. And recipes like the staticlxml one to solve those pesky weird corner cases! reinout -- Reinout van Rees - reinout@vanrees.org - http://reinout.vanrees.org Software developer at http://www.thehealthagency.com "Military engineers build missiles. Civil engineers build targets"
participants (5)
-
David Cournapeau
-
David Lyon
-
Floris Bruynooghe
-
Maurits van Rees
-
Reinout van Rees