ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

Does not have Python 3 support. #17

Closed asweigart closed 9 years ago

asweigart commented 10 years ago

I can't import this on Python 3.2, 3.3, or 3.4 on Windows 7. Works on 2.7 though.

C:\Users\Al>py -3.2
Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyscreenshot import grab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python32\lib\site-packages\pyscreenshot\__init__.py", line 4, in <module>
    from pyscreenshot.loader import Loader, FailedBackendError
  File "C:\Python32\lib\site-packages\pyscreenshot\loader.py", line 2, in <module>
    from pyscreenshot import plugins
  File "C:\Python32\lib\site-packages\pyscreenshot\plugins\__init__.py", line 1, in <module>
    from . import gtkpixbuf
  File "C:\Python32\lib\site-packages\pyscreenshot\plugins\gtkpixbuf.py", line 1, in <module>
    from .PIL import Image
ImportError: No module named PIL
>>> import pyscreenshot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python32\lib\site-packages\pyscreenshot\__init__.py", line 4, in <module>
    from pyscreenshot.loader import Loader, FailedBackendError
  File "C:\Python32\lib\site-packages\pyscreenshot\loader.py", line 2, in <module>
    from pyscreenshot import plugins
  File "C:\Python32\lib\site-packages\pyscreenshot\plugins\__init__.py", line 1, in <module>
    from . import gtkpixbuf
  File "C:\Python32\lib\site-packages\pyscreenshot\plugins\gtkpixbuf.py", line 1, in <module>
    from .PIL import Image
ImportError: No module named PIL
ponty commented 10 years ago

Please check the README. Python3 support is missing at the moment. Pyscreenshot is a thin wrapper, so first the backends should be checked for Py3 compatibility.

You don't need Pyscreenshot on Windows, because PIL and Pillow can be also used for screenshots.

ponty commented 9 years ago

Done!

asweigart commented 9 years ago

Awesome to hear!

kevinmickey commented 9 years ago

I had success with pyscreenshot in python 2.7, but when I tried python 3.4 in a virtualenvironment, I got this import error:

  File "project.py", line 3, in <module>
    from pyscreenshot import grab, grab_to_file
  File "/Users/kevin/project/venv/lib/python3.4/site-packages/pyscreenshot/__init__.py", line 4, in <module>
    from pyscreenshot.loader import Loader, FailedBackendError
  File "/Users/kevin/project/venv/lib/python3.4/site-packages/pyscreenshot/loader.py", line 2, in <module>
    from pyscreenshot import plugins
  File "/Users/kevin/project/venv/lib/python3.4/site-packages/pyscreenshot/plugins/__init__.py", line 1, in <module>
    from . import gtkpixbuf
  File "/Users/kevin/project/venv/lib/python3.4/site-packages/pyscreenshot/plugins/gtkpixbuf.py", line 1, in <module>
    from .PIL import Image
ImportError: No module named 'pyscreenshot.plugins.PIL'

When I install the latest commit (b3629a5a138c2e5d81c44aa89a9e2fb2e52d5caa), I get a similar error (although wxscreen is introduced first):

  File "project.py", line 3, in <module>
    from pyscreenshot import grab, grab_to_file
  File "/Users/kevin/project/venv/src/pyscreenshot/build/lib/pyscreenshot/__init__.py", line 5, in <module>
    from pyscreenshot.loader import Loader, FailedBackendError
  File "/Users/kevin/project/venv/src/pyscreenshot/build/lib/pyscreenshot/loader.py", line 2, in <module>
    from pyscreenshot import plugins
  File "/Users/kevin/project/venv/src/pyscreenshot/build/lib/pyscreenshot/plugins/__init__.py", line 5, in <module>
    from pyscreenshot.plugins import wxscreen, gtkpixbuf, qtgrabwindow, scrot, \
  File "/Users/kevin/project/venv/src/pyscreenshot/build/lib/pyscreenshot/plugins/wxscreen.py", line 1, in <module>
    from .PIL import Image
ImportError: No module named 'pyscreenshot.plugins.PIL'

I can run from PIL import Image by itself in my virtual environment (Pillow==2.8.1 is installed) without receiving errors.