Russ Johnson | 1 Jun 19:34 2010
Picon

Unable to build lxml 2.2.6 on WinXP

I'm attempting to built lxml 2.2.6 with MinGW for Python 2.7b2 on
Windows XP Pro SP 3 using
static linking, but the build fails with the following error.  Any suggestions?

C:\lxml-2.2.6>python setup.py install --static
Building lxml version 2.2.6.
NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c'
needs to be available.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
Building against libxml2/libxslt in one of the following directories:
  ..\iconv-1.9.2.win32\lib
  ..\libxml2-2.7.6.win32\lib
  ..\libxslt-1.1.26.win32\lib
  ..\zlib-1.2.3.win32\lib
running install
install_dir C:\Python27\Lib\site-packages\
running bdist_egg
running egg_info
writing src\lxml.egg-info\PKG-INFO
writing top-level names to src\lxml.egg-info\top_level.txt
writing dependency_links to src\lxml.egg-info\dependency_links.txt
reading manifest file 'src\lxml.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
(Continue reading)

Sidnei da Silva | 1 Jun 22:21 2010
Picon

Re: Unable to build lxml 2.2.6 on WinXP

On Tue, Jun 1, 2010 at 2:34 PM, Russ Johnson
<Russell.S.Johnson <at> gmail.com> wrote:
> I'm attempting to built lxml 2.2.6 with MinGW for Python 2.7b2 on
> Windows XP Pro SP 3 using
> static linking, but the build fails with the following error.  Any suggestions?

I have never tried to build with MinGW, so no clue on that.

I know there are many people waiting for a 2.2.6 build for Windows,
which I forgot to upload when I built the others. Stefan advised me to
build it against libxml2 2.7.7 because of some potential crasher bugs,
so I'm waiting for a new build from
http://www.zlatkovic.com/libxml.en.html, which is where I get the
libxml2 binaries from.

OTOH, I *can* make a 2.2.6 build with libxml2 2.7.6 right now if
people are willing to put up with potential crashes.

Sorry everyone for not speaking up earlier. Between traveling and news
that I will be dad of twins, life has been crazy lately. I'll make
sure to put up a Baby Registry on Amazon where you can kindly
contribute to my happiness as I do to yours *wink*.

-- Sidnei
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Stefan Behnel | 2 Jun 10:16 2010
Picon

Re: Unable to build lxml 2.2.6 on WinXP

Russ Johnson, 01.06.2010 19:34:
> I'm attempting to built lxml 2.2.6 with MinGW for Python 2.7b2 on
> Windows XP Pro SP 3 using
> static linking, but the build fails with the following error.  Any suggestions?
>
> C:\lxml-2.2.6>python setup.py install --static
> Building lxml version 2.2.6.
> NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c'
> needs to be available.
> ERROR: 'xslt-config' is not recognized as an internal or external command,
> operable program or batch file.
 > ** make sure the development packages of libxml2 and libxslt are
 > installed **

It tells you that you need to have "xslt-config" in your PATH. It comes 
with libxslt. Not sure if this is required for the static build, though.

> Using build configuration of libxslt
> Building against libxml2/libxslt in one of the following directories:
>    ..\iconv-1.9.2.win32\lib
>    ..\libxml2-2.7.6.win32\lib
>    ..\libxslt-1.1.26.win32\lib
>    ..\zlib-1.2.3.win32\lib

This looks ok.

> running install
> install_dir C:\Python27\Lib\site-packages\
> running bdist_egg
> running egg_info
(Continue reading)

Sidnei da Silva | 2 Jun 14:36 2010
Picon

Re: Unable to build lxml 2.2.6 on WinXP

On Wed, Jun 2, 2010 at 5:16 AM, Stefan Behnel <stefan_ml <at> behnel.de> wrote:
> It tells you that you need to have "xslt-config" in your PATH. It comes
> with libxslt. Not sure if this is required for the static build, though.

It's not. At least I have ignored it forever and haven't had an issue.

-- Sidnei
Russ Johnson | 2 Jun 14:33 2010
Picon

Re: Unable to build lxml 2.2.6 on WinXP

That's the thing, I got the libraries from ftp://ftp.zlatkovic.com/pub/libxml/, as indicated in http://codespeak.net/lxml/build.html#static-linking-on-windows.  However, I can't find xslt-config anywhere in libxslt.  Is there somewhere else I should/could get them from?


Full output is here: http://docs.google.com/document/pub?id=1lFTEQaW-76immaD3f9pDGDVZj26Dbs0iF6p3PxtzZRk

On Wed, Jun 2, 2010 at 4:16 AM, Stefan Behnel <stefan_ml <at> behnel.de> wrote:
Russ Johnson, 01.06.2010 19:34:

I'm attempting to built lxml 2.2.6 with MinGW for Python 2.7b2 on
Windows XP Pro SP 3 using
static linking, but the build fails with the following error.  Any suggestions?

C:\lxml-2.2.6>python setup.py install --static
Building lxml version 2.2.6.
NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c'
needs to be available.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
> ** make sure the development packages of libxml2 and libxslt are
> installed **

It tells you that you need to have "xslt-config" in your PATH. It comes with libxslt. Not sure if this is required for the static build, though.



Using build configuration of libxslt
Building against libxml2/libxslt in one of the following directories:
  ..\iconv-1.9.2.win32\lib
  ..\libxml2-2.7.6.win32\lib
  ..\libxslt-1.1.26.win32\lib
  ..\zlib-1.2.3.win32\lib

This looks ok.



running install
install_dir C:\Python27\Lib\site-packages\
running bdist_egg
running egg_info
writing src\lxml.egg-info\PKG-INFO
writing top-level names to src\lxml.egg-info\top_level.txt
writing dependency_links to src\lxml.egg-info\dependency_links.txt
reading manifest file 'src\lxml.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
warning: no files found matching 'etree_defs.h' under directory 'src\lxml'

This looks weird. They seem to exist below ...



writing manifest file 'src\lxml.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
running build_ext
building 'lxml.etree' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -I..\iconv-1.9.2.win32\include -
I..\libxml2-2.7.6.win32\include -I..\libxslt-1.1.26.win32\include -I..\zlib-1.2.
3.win32\include -IC:\Python27\include -IC:\Python27\PC -c src/lxml/lxml.etree.c
-o build\temp.win32-2.7\Release\src\lxml\lxml.etree.o -w
writing build\temp.win32-2.7\Release\src\lxml\etree.def
C:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.7\Release\src\lxm
l\lxml.etree.o build\temp.win32-2.7\Release\src\lxml\etree.def -L..\iconv-1.9.2.
win32\lib -L..\libxml2-2.7.6.win32\lib -L..\libxslt-1.1.26.win32\lib -L..\zlib-1
.2.3.win32\lib -LC:\Python27\libs -LC:\Python27\PCbuild -llibxslt_a -llibexslt_a
 -llibxml2_a -liconv_a -lzlib -lWS2_32 -lpython27 -lmsvcr90 -o build\lib.win32-2
.7\lxml\etree.pyd
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MS
VCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MS
VCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MS
VCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"ws
2_32.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized

-- snip --

collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

The "snip" hides the interesting part.

Stefan

_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Sergio Monteiro Basto | 2 Jun 17:34 2010
Picon

another bug

Hi, I have many sites on test. 

a parking domain, 

import lxml.html
hparser = lxml.html.HTMLParser(encoding='utf-8', remove_comments=True)

content="""<frameset>                                                                                                       

        <frame src="main.php" name="srcpg"
id="srcpg"                                                            
        frameborder="0" scrolling="Auto" marginwidth=""
marginheight="0">                                        

</frameset>"""

etree_document = lxml.html.fromstring(content, parser=hparser)
TypeError                                 Traceback (most recent call
last)

/home/sergio/≤ipython console> in <module>()

/usr/lib/python2.6/site-packages/lxml/html/__init__.pyc in
fromstring(html, base_url, parser, **kw)
    634                 other_head.drop_tree()
    635         return doc
--> 636     if (len(body) == 1 and (not body.text or not
body.text.strip())
    637         and (not body[-1].tail or not
body[-1].tail.strip())):                                           
    638         # The body has just one element, so it was probably a
single

TypeError: object of type 'NoneType' has no len()

thanks, 
--

-- 
Sérgio M. B.
Attachment (smime.p7s): application/x-pkcs7-signature, 4451 bytes
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Edgardo C. | 4 Jun 14:07 2010
Picon

lxml for Python 3.1

Hello everyone,

I've installed Ubuntu 10.04LTS in my pc and python-lxml 2.2.4-1 is already in. I installed it, but once done it finished in the Python 2.6 already installed version. But, I'm developing for 3.1 and I would like to have lxml working for it. My question is, does the last version of lxml compile for Python 3.1? What do I need for that? I would really appreciate any help because I need it very soon. Thanks in advance,

Ed.

_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
Ovnicraft | 4 Jun 17:06 2010
Picon

Re: lxml for Python 3.1



2010/6/4 Edgardo C. <edxxgardo <at> gmail.com>
Hello everyone,

I've installed Ubuntu 10.04LTS in my pc and python-lxml 2.2.4-1 is already in. I installed it, but once done it finished in the Python 2.6 already installed version. But, I'm developing for 3.1 and I would like to have lxml working for it. My question is, does the last version of lxml compile for Python 3.1? What do I need for that? I would really appreciate any help because I need it very soon. Thanks in advance,


I didnt try it in 3.1 so i suggest you, try to install it in 3.1, identify the errors and report them **if** you get them.

In another hand python community recommend still develop in 2.X versions, BTW in your choice can help to test lxml in 3.x

my 2c


Ed.

_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev




--
Cristian
_______________________________________________
lxml-dev mailing list
lxml-dev <at> codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev
codethief | 4 Jun 18:39 2010
Picon

Re: lxml for Python 3.1

lxml should work fine with Python 3. There are a few bugs (see
previous posts in this mailing list) but aside from that it works. And
if you come across such a bug, you can still report it here, as
Ovnicraft suggested. ;)
Just do a "$ easy_install3 lxml" and you should be good to go. (If you
haven't installed easy_install3, you must do that first, of course.)

On Fri, Jun 4, 2010 at 2:07 PM, Edgardo C. <edxxgardo <at> gmail.com> wrote:
> Hello everyone,
>
> I've installed Ubuntu 10.04LTS in my pc and python-lxml 2.2.4-1 is already
> in. I installed it, but once done it finished in the Python 2.6 already
> installed version. But, I'm developing for 3.1 and I would like to have lxml
> working for it. My question is, does the last version of lxml compile for
> Python 3.1? What do I need for that? I would really appreciate any help
> because I need it very soon. Thanks in advance,
>
> Ed.
>
> _______________________________________________
> lxml-dev mailing list
> lxml-dev <at> codespeak.net
> http://codespeak.net/mailman/listinfo/lxml-dev
>
>

--

-- 
Simon Hirscher
http://simonhirscher.de
Isaac Wagner | 8 Jun 18:40 2010

Pretty print indent level

Here's a little snippet of what I'm doing:

from lxml import etree
doc = etree.parse(file)
text = etree.tostring(doc, pretty_print=True)
...

So, that works great and outputs a nicely formatted XML document.
However, the indent level of pretty_print is 2 spaces whereas I'd like
4 spaces.  Is there any way to control the number of spaces per indent
level?

Gmane