[reportlab-users] Unable to install with python 2.7.3

3 views
Skip to first unread message

Moretti Sébastien

unread,
Nov 29, 2012, 7:45:25 AM11/29/12
to reportl...@lists2.reportlab.com
Hi

I am new to reportlab and try to install it from source on python 2.7.3
Linux.

Build and install steps work fine but I experience errors with tests.
All errors are XML related (I joined part of the output)

All listed requirements are there, so I don't see what is missing.
Thanks


.....................E............E...........................E............................................................E...........Failed
to import renderPM.
Traceback (most recent call last):
File "graphdocpy.py", line 982, in <module>
main()
File "graphdocpy.py", line 952, in main documentPackage0(nameOrPath,
builder, options)
File "graphdocpy.py", line 895, in documentPackage0
os.path.walk(path, _packageWalkCallback, (builder, opts))
File "/software/lib64/python2.7/posixpath.py", line 237, in walk
walk(name, func, arg)
File "/software/lib64/python2.7/posixpath.py", line 229, in walk
func(arg, top, names)
File "graphdocpy.py", line 862, in _packageWalkCallback
documentModule0(f, builder)
File "graphdocpy.py", line 836, in documentModule0
builder.write(s)
File "./docpy.py", line 510, in write
self.skeleton.walk(self)
File "./docpy.py", line 433, in walk
f.beginClass(k, cDoc, bases)
File "graphdocpy.py", line 284, in beginClass
self.beginAttributes(aClass)
File "graphdocpy.py", line 321, in beginAttributes
"<b>%s</b> %s" % (name, desc), self.bt))
File
"/builddir/build/BUILD/reportlab-2.6/src/reportlab/platypus/paragraph.py",
line 919, in __init__
self._setup(text, style, bulletText or
getattr(style,'bulletText',None), frags, cleanBlockQuotedText)
File
"/builddir/build/BUILD/reportlab-2.6/src/reportlab/platypus/paragraph.py",
line 937, in _setup
% (_parser.errors[0],text[:min(30,len(text))]))
ValueError: xml parser error (bogus < or &) in paragraph beginning
'<b>gridStrokeLineCap</b> Grid '
.............................................E.................E........
======================================================================
ERROR: test0 (test_platypus_index.IndexTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/builddir/build/BUILD/reportlab-2.6/tests/test_platypus_index.py", line
108, in test0
para = Paragraph(txt, makeBodyStyle())
File
"/builddir/build/BUILD/reportlab-2.6/src/reportlab/platypus/paragraph.py",
line 919, in __init__
self._setup(text, style, bulletText or
getattr(style,'bulletText',None), frags, cleanBlockQuotedText)
File
"/builddir/build/BUILD/reportlab-2.6/src/reportlab/platypus/paragraph.py",
line 937, in _setup
% (_parser.errors[0],text[:min(30,len(text))]))
ValueError: xml parser error (; missing after entity/char reference) in
paragraph beginning
'Marks &amp; Spencer - purveyor'
======================================================================


--
Sébastien Moretti

_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users

Robin Becker

unread,
Nov 29, 2012, 7:51:43 AM11/29/12
to reportlab-users
Sébastien,

I think you are missing some/all of the C extensions. I'm not exactly sure how
you installed, but presumably at least _renderPM.so is missing which causes most
if not all of the graphics stuff to fail.

If you try to install with the system python you'll normally need to use sudo to
make setup.py install work properly.
--
Robin Becker

On 29/11/2012 12:45, Moretti Sébastien wrote:
> Hi
>
> I am new to reportlab and try to install it from source on python 2.7.3 Linux.
>
> Build and install steps work fine but I experience errors with tests.
> All errors are XML related (I joined part of the output)
>
> All listed requirements are there, so I don't see what is missing.
> Thanks
>
>
> .....................E............E...........................E............................................................E...........Failed
> to import renderPM.
> Traceback (most recent call last):
> File "graphdocpy.py", line 982, in <module>
...........

Moretti Sébastien

unread,
Nov 29, 2012, 8:19:05 AM11/29/12
to Robin Becker, reportlab-users
> Sébastien,
>
> I think you are missing some/all of the C extensions. I'm not exactly
> sure how you installed, but presumably at least _renderPM.so is missing
> which causes most if not all of the graphics stuff to fail.

Everything listed as required is installed on my system.

I tried with
python ./setup.py install --root test
python setup.py tests
or with
python ./setup.py build
python setup.py tests

_renderPM.so looks to be created properly in
reportlab-2.6/build/lib.linux-x86_64-2.7/_renderPM.so


> If you try to install with the system python you'll normally need to use
> sudo to make setup.py install work properly.

No need of sudo with --root ?

Robin Becker

unread,
Nov 29, 2012, 8:49:12 AM11/29/12
to Moretti Sébastien, reportlab-users
On 29/11/2012 13:19, Moretti Sébastien wrote:
>> Sébastien,
>>
>> I think you are missing some/all of the C extensions. I'm not exactly
>> sure how you installed, but presumably at least _renderPM.so is missing
>> which causes most if not all of the graphics stuff to fail.
>
> Everything listed as required is installed on my system.
>
> I tried with
> python ./setup.py install --root test
> python setup.py tests
> or with
> python ./setup.py build
> python setup.py tests
>
> _renderPM.so looks to be created properly in
> reportlab-2.6/build/lib.linux-x86_64-2.7/_renderPM.so
>
>
>> If you try to install with the system python you'll normally need to use
>> sudo to make setup.py install work properly.
>
> No need of sudo with --root ?
>
so what happens when you type

python -c"import renderPM" ?

--
Robin Becker

Robin Becker

unread,
Nov 29, 2012, 8:52:00 AM11/29/12
to Moretti Sébastien, reportlab-users
On 29/11/2012 13:19, Moretti Sébastien wrote:
>> Sébastien,
>

also can you see font files with names like

> sy______.pfb
> zd______.pfb
> coo_____.pfb
> com_____.pfb
> cob_____.pfb
> cobo____.pfb
> zx______.pfb
> zy______.pfb
> _ab_____.pfb
> _abi____.pfb
> _a______.pfb
> _ai_____.pfb
> _ebi____.pfb
> _ei_____.pfb
> _er_____.pfb
> _eb_____.pfb

in the reportlab/fonts dir after the install? These are needed for _renderPM.so
to work properly.
--
Robin Becker

Moretti Sébastien

unread,
Nov 29, 2012, 9:01:19 AM11/29/12
to Robin Becker, reportlab-users
python -c "import renderPM"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named renderPM

renderPM is part of reportlab or comes from somewhere else ?

>>> Sébastien,
>>
>
> also can you see font files with names like
>
>> sy______.pfb
>> zd______.pfb
>> coo_____.pfb
>> com_____.pfb
>> cob_____.pfb
>> cobo____.pfb
>> zx______.pfb
>> zy______.pfb
>> _ab_____.pfb
>> _abi____.pfb
>> _a______.pfb
>> _ai_____.pfb
>> _ebi____.pfb
>> _ei_____.pfb
>> _er_____.pfb
>> _eb_____.pfb
>
> in the reportlab/fonts dir after the install? These are needed for
> _renderPM.so to work properly.

I have these files:
./build/lib.linux-x86_64-2.7/reportlab/fonts/_er_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/coo_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/DarkGardenMK.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_eb_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_a______.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/cob_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/com_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/zy______.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/sy______.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_abi____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/cobo____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_ab_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/zx______.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/zd______.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_ebi____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_ai_____.pfb
./build/lib.linux-x86_64-2.7/reportlab/fonts/_ei_____.pfb

--
Sébastien Moretti

Mark Erbaugh

unread,
Nov 29, 2012, 9:15:02 AM11/29/12
to reportlab-users
Is there a way to install reportlab into a virtualenv on Windows? Using pip to install fails as I don't have a C compiler installed. The Windows installer only offers to install to my global Python installation.

Thanks,
Mark

Robin Becker

unread,
Nov 29, 2012, 9:28:48 AM11/29/12
to reportlab-users
On 29/11/2012 14:15, Mark Erbaugh wrote:
> Is there a way to install reportlab into a virtualenv on Windows? Using pip to install fails as I don't have a C compiler installed. The Windows installer only offers to install to my global Python installation.
>
> Thanks,
> Mark
.....

I think you can install just the python part with the python from the venv and
then try copying the DLLs into place from the website eg



> http://www.reportlab.com/ftp/amd64-dlls-py27.zip

or

> http://www.reportlab.com/ftp/win32-dlls-py27.zip

If all else fails take the source distro and copy the src/reportlab/ folder into
the venv site-packages folder so you have

lib/site-packages/reportlab/.....

and then copy the dlls into

lib/site-packages/

Check you can import the dlls with eg

python -c"import _rl_accel"

and reportlab with python -c"import reportlab".

We do supply all the bits and also the EXE installers, but probably they don't
cooperate with pip / virtual env etc etc.
--
Robin Becker

Robin Becker

unread,
Nov 29, 2012, 10:07:21 AM11/29/12
to USERS REPORTLAB
Since we are already downloading from the web (or at least attempting that) we
could probably also check our platform is windows and skip the builds of the
DLLs in special cases. The appropriate DLLs could then just be downloaded and
copied to the appropriate location if installing.


On 29/11/2012 15:00, Mark Erbaugh wrote:
> Robin,
>
> Thanks. I'll give it a try next time I'm on my Windows machine.
>
> Mark
>
........

Moretti Sébastien

unread,
Nov 29, 2012, 11:28:20 AM11/29/12
to reportlab-users
Once installed at the --root place (in the final python place), tests
run fine.
Tests fail when files are not in the python "normal" tree.

Thanks

>>> My bad,
>>>
>>> try
>>>
>>>
>>> python -c"from reportlab.graphics import renderPM"
>>
>> After
>> cd ./build/lib.linux-x86_64-2.7/
>> the command
>> python -c"from reportlab.graphics import renderPM"
>> returns no error message.
>>
>> It looks setup.py tests does not look at the right place, after a
>> setup.py build
>> OR a setup.py install with --root
>>
>>> renderPM.py is the pixmap renderer that we use for bit maps etc etc. It
>>> needs PIL to run and also the extension _renderPM.so. However, it needs
>>> to initialize its canvas with a standard font (like the PDF canvas) so
>>> we are using the Helvetica outlines (from _a______.pfb).
>>>
>>> You seem to have those so can you also try
>>>
>>> python -c"import PIL" to check that PIL is installed.
>>
>> OK for PIL, no error message.
>>
> well you should be able to run the tests directly in the tests folder by
> running
>
> python ./runAll.py

--
Sébastien Moretti
SIB Vital-IT EMBnet, Quartier Sorge - Genopode
CH-1015 Lausanne, Switzerland
Tel.: +41 (21) 692 4079/4221
http://www.vital-it.ch/ http://myhits.vital-it.ch/
Reply all
Reply to author
Forward
0 new messages