[reportlab-users] Can't get reportlab to work

Brian Kessler kessler.bm at gmail.com
Thu Jul 29 07:57:54 EDT 2010


Just realized my remaining problem:

Somehow, the extension ".py" is still associated with Python 2.7, so if I
use "manage.py shell", Python 2.7 launches.

However, if I use "python manage.py shell", Python 2.6.5 launches and I can
import reportlab.

Cheers for the help.

Best regards,

-Brian.


--
Brian Kessler
kessler.bm at gmail.com
+36 30 637 1824



-----Original Message-----
From: Brian Kessler [mailto:kessler.bm at gmail.com]
Sent: 29 July 2010 13:44
To: 'Robin Becker'; 'reportlab-users'
Subject: RE: [reportlab-users] Can't get reportlab to work

Dear Robin,

Thank you for your response.

With regard to your questions:


>perhaps you can say how you installed reportlab/rlextra


To install rlextra:

1. Open PowerCmd
2. At command prompt:

C:\shell\bblean>d:
D:\>cd D:\downloads\Developer Tools\python\python 2.6
D:\downloads\Developer Tools\python\python
2.6>rlextra-2.4.win32-py2.6.exe

3. In rlextra-2.4 window

Next >

Window Displays:

Python Version 2.6 (found in registry)
Python Directory C:\devtool\Python26\
Installation Directory
C:\devtool\Python26\Lib\site-packages\

Next >
Next >
Finish

4. Back at command prompt:

D:\downloads\Developer Tools\python\python 2.6>c:
C:\shell\bblean>cd C:\devtool\Python26\Lib\site-packages\rlextra
C:\devtool\Python26\Lib\site-packages\rlextra>python testall.py


Now (unlike before), this worked with the following results:


............................................................................
.........................................................
----------------------------------------------------------------------
Ran 133 tests in 32.500s

OK


However, I am still having problems importing reportlab:

C:\devtool\Python26\Lib\site-packages\rlextra>d:
D:\downloads\Developer Tools\python\python 2.6>cd
\education\python\FirstProject\mysite\
D:\education\python\FirstProject\mysite>manage.py shell
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import reportlab
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named reportlab
>>>




>Can you confirm that you have only one python and that it's installed at

c:\devtool\Python26?

There are two Pythons. The second is Python 2.7 and installed to
c:\devtool\Python27

However, my environmental variables are only configured for 2.6:

PATH = C:\WINDOWS\system32;%CommonProgramFiles%\Microsoft Shared\Windows
Live;C:\devtool\Java\Sun\SDK\bin;%JAVA_HOME%\bin;%ANT_HOME%\bin;C:\devtool\C
ollabNet Subversion

Server;C:\devtool\Python26\;C:\devtool\Python26\scripts;C:\devtool\PostgreSQ
L\8.4\bin;
PYTHONPATH = C:\devtool\Python26



>Are there files called

>C:\devtool\Python26\Lib\site-packages\rlextra\test\test_layout.py

>C:\devtool\Python26\Lib\site-packages\rlextra\test\__init__.py

>C:\devtool\Python26\Lib\site-packages\reportlab\__init__.py


Yes, on all counts.


>What happens when you try executing



>C:\devtool\Python26\python.exe -c"import sys;print sys.path"


['', 'C:\\devtool\\Python26', 'C:\\WINDOWS\\system32\\python26.zip',
'C:\\devtool\\Python26\\DLLs', 'C:\\devtool\\Python26\\lib',
'C:\\devtool\\Python26\\lib\\plat-win',
'C:\\devtool\\Python26\\lib\\lib-tk',
'C:\\devtool\\Python26\\lib\\site-packages',
'C:\\devtool\\Python26\\lib\\site-packages\\PIL',
'C:\\devtool\\Python26\\lib\\site-packages\\win32',
'C:\\devtool\\Python26\\lib\\site-packages\\win32\\lib',
'C:\\devtool\\Python26\\lib\\site-packages\\Pythonwin']


Best regards,

-Brian.



On 29/07/2010 01:33, Brian Kessler wrote:

> Dear All,

>

> I am currently attempting to work through a tutorial on Django which

> brought ReportLab to my attention.

>

> Unfortunately, I am having a problem getting it to work.

>

> If I go to C:\devtool\Python26\Lib\site-packages\rlextra and try:

>

> testall.py

>

> I get:

>

> Traceback (most recent call last):

> File "C:\devtool\Python26\Lib\site-packages\rlextra\testall.py",

> line 136, in<module>

> unittest.TextTestRunner().run(makeSuite())

> File "C:\devtool\Python26\Lib\site-packages\rlextra\testall.py",

> line 68, in makeSuite

> import rlextra.test.test_layout

> ImportError: No module named rlextra.test.test_layout

>

> ... And (more critically) when I am in manage.py shell, after:

>

>>>> import reportlab

>

> I get:

>

> Traceback (most recent call last):

> File "<console>", line 1, in<module>

> ImportError: No module named reportlab

>

>

> My stack includes:

>

> Windows XP SP3

> Python 2.6.5

> Django (svn revision 13448)

> PIL-1.1.7

> Pmw-1.3.2

> Psycopg2-2.0.14

> Pywin32-214

> Reportlab-2.4

> Rlextra-2.4

> Apache 2.2

> Mod_wsgi-3.3

>

>

> Any idea what I am doing wrong or how to fix it?

>

>

>

>

> Best regards,

>

> -Brian.

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at lists2.reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

>





More information about the reportlab-users mailing list