Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > import ImageGrab fails on Ubuntu 10.4

Reply
Thread Tools

import ImageGrab fails on Ubuntu 10.4

 
 
News123
Guest
Posts: n/a
 
      10-31-2010
Hi,

It's the first time I wanted to use ImageGrab.

importing ImageGrab fails as seen below:


$ python -c "import ImageGrab"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/PIL/ImageGrab.py", line 34, in
<module>
import _grabscreen
ImportError: No module named _grabscreen
$


Is this an issue for all Ubuntu 10.4 releases or is this only failing on
my host?


Thanks in advance

 
Reply With Quote
 
 
 
 
News123
Guest
Posts: n/a
 
      10-31-2010
On 10/31/2010 05:04 PM, News123 wrote:

> importing ImageGrab un Ubuntu 10.4 fails as seen below:
>
> import _grabscreen
> ImportError: No module named _grabscreen
>



Well I found a partial answer on
http://www.pythonware.com/library/pi.../imagegrab.htm

> The ImageGrab module can be used to copy the contents of the screen or the clipboard to a PIL image memory.
>
> The current version works on Windows only.



I just wonder why there is no cleaerer message like

"platform not supported"


As a workaround I use now:

cmd = "import -window root %s" % fname
os.system(cmd)
img = Image.open(fname)

using the 'import' command of the ImageMagick tool kit

Is there any other way to make screen shots in Linux, ideally without
creating an intermediate file
 
Reply With Quote
 
 
 
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      11-01-2010
In message <4ccd954f$0$12350$(E-Mail Removed)>, News123 wrote:

> Is there any other way to make screen shots in Linux, ideally without
> creating an intermediate file


The ImageMagick “import” command lets you grab the contents of any window
(including the root window) from your X server
<http://www.imagemagick.org/script/import.php>. It wants an output filename,
but of course that can be /dev/stdout, e.g.

import -window root /dev/stdout | display

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ImageGrab gslm Python 0 04-04-2007 09:47 PM
ImageGrab gslm Python 0 04-03-2007 08:46 PM
PIL - ImageGrab - ImportError: The _imaging C module is not installed Askari Python 1 09-06-2004 08:07 PM
PIL ImageGrab.grab memory leak Erik Max Francis Python 0 07-21-2004 02:43 AM



Advertisments