GASP error in Linux Ubuntu Netbook edition

Asked by tsavas on 2010-12-16

Hello,

I'm trying to learn Python and thats the primary reason I installed Ubuntu.

The GASP package does not currently support Windows so I think it would be smoother with Ubuntu on my netbook. Can someone running Ubuntu 10.10 and has GASP installed tell me if they can run the following code without issues:

Code:

from gasp import *

begin_graphics(800, 600, title="Catch", background=color.YELLOW)
set_speed(120)

ball_x = 10
ball_y = 300
ball = Circle((ball_x, ball_y), 10, filled=True)
dx = 4
dy = 1

while ball_x < 810:
    ball_x += dx
    ball_y += dy
    move_to(ball, (ball_x, ball_y))
    update_when('next_tick')

end_graphics()

----
for me, a yellow screen appears only for a second and then I get:

>>> from gasptry import *
Exception in thread QueueFeederThread (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
File "/usr/lib/python2.6/threading.py", line 484, in run
File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed
<class 'cPickle.PicklingError'>: Can't pickle gasp.api.Circle: import of module gasp.api failed

Question information

Language:
English Edit question
Status:
Solved
For:
GASP Core Edit question
Assignee:
No assignee Edit question
Solved by:
tsavas
Solved:
2010-12-22
Last query:
2010-12-22
Last reply:
2010-12-16
Luke Faraone (lfaraone) said : #1

On 12/16/2010 09:15 AM, tsavas wrote:
> The GASP package does not currently support Windows so I think it would be smoother with Ubuntu on my netbook. Can someone running Ubuntu 10.10 and has GASP installed tell me if they can run the following code without issues:

How did you install GASP? What version are you on? (it's recommended to
use the version from the repositories, "sudo apt-get install python-gasp")

--
╒═════════════════════════════════════════════════════════════════╕
│Luke Faraone ╭Debian / Ubuntu Developer╮│
http://luke.faraone.cc ╰Sugar Labs, Systems Admin╯│
│PGP: 5189 2A7D 16D0 49BB 046B DC77 9732 5DD8 F9FD D506 │
╘═════════════════════════════════════════════════════════════════╛

tsavas (turgan) said : #2

when I do "sudo apt-get install python-gasp" I get the message that:

python-gasp is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic

As far as I remember I installed GASP via Ubuntu Software Center though.

tsavas (turgan) said : #3

The version I installed in Ubuntu Software Center shows 0.3.3-1 (python-gasp)

GASP download at http://dev.laptop.org/pub/gasp/downloads/ shows latest version as: 0.3.2

Python version on Ubuntu is Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)

also how do I know which version of GASP I have currently installed?

Kevin Cole (kjcole) said : #4

On Thu, Dec 16, 2010 at 10:01, tsavas
<email address hidden>wrote:

also how do I know which version of GASP I have currently installed?

Assuming you installed a .deb package (e.g. via apt-get or similar program)

$ *dpkg -l python-gasp*

should give you a bit of info... That command returns the following for me:

*ii python-gasp 0.3.3-1 procedural Python graphics library for beginning
programmers*

--
Ubuntu Linux DC LoCo
Washington, DC
http://dc.ubuntu-us.org/

tsavas (turgan) said : #5

Thanks, yes same version here: python-gasp 0.3.3-1

tsavas (turgan) said : #6

I was trying to run my scripts with "from gasptry import *" from within python.

When I tried typing "python gasptry" within terminal it actually worked.