Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPDF can avoid "PIL not found" error #40

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment
Closed

FPDF can avoid "PIL not found" error #40

GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

When installing PIL through pip-installing Pillow, no PIL.pth is placed in the 
site-packages directory. 

When no PIL.pth file exists PIL should be used like so:
from PIL import Image

When the PIL.pth does exist, PIL can be used like this:
import Image

(see 
http://stackoverflow.com/questions/8339991/why-in-python-sometimes-from-pil-impo
rt-image-fails-and-import-image-works for more info)

But PFPDF only checks for the latter case:

try:
    # Check if PIL is available, necessary for JPEG support.
    import Image
except ImportError:
    Image = None

It would be convenient if the other case were tested for.

Original issue reported on code.google.com by mjmare31...@gmail.com on 15 Jan 2013 at 9:08

@GoogleCodeExporter
Copy link
Author

Thanks you for the report

There is a similar approach in the Issue 34:

http://code.google.com/p/pyfpdf/issues/detail?id=34

Let me know what do you think there (it is pending commit)

Original comment by reingart@gmail.com on 15 Jan 2013 at 3:43

  • Changed state: Duplicate
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant