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

IndexError when running cells.py #18

Open
markoconnor opened this issue Jun 4, 2010 · 2 comments
Open

IndexError when running cells.py #18

markoconnor opened this issue Jun 4, 2010 · 2 comments
Labels

Comments

@markoconnor
Copy link

Seen every time I run the master at the moment:

Traceback (most recent call last):
File "cells.py", line 547, in
game.tick()
File "cells.py", line 210, in tick
self.plant_population, self.energy_map)
File "cells.py", line 456, in update
pygame.transform.scale(pygame.surfarray.make_surface(numpy.array(img)),
File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/surfarray.py", line 243, in make_surface
return numpysf.make_surface (array)
File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/_numpysurfarray.py", line 368, in make_surface
blit_array (surface, array)
File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/_numpysurfarray.py", line 437, in blit_array
surface.get_buffer ().write (data, 0)
IndexError: bytes to write exceed buffer size

Also seen by icefox on ubuntu karmic. Works on Fedora 12.

My pygame is 1.9.1release and numpy is 1.2.1 on the OS/X box that gets the error.
On Fedora 12, where it works, they're 1.9.1release and 1.3.0 respectively.

UPDATE: when trying to get psycho working, I ran this to force python into 32-bit mode:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

it didn't work, but now I can run cells.py just fine on my OS/X box, too.

@pavellishin
Copy link

I didn't try to install psyco, but I tried the 32-bit mode trick - it changed the error message, but the game still won't run.

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
python cells.py minds/mind1.py minds/mind2.py

results in

Traceback (most recent call last):
  File "cells.py", line 15, in <module>
    import pygame, pygame.locals
  File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/__init__.py", line 95, in <module>
    from pygame.base import *
ImportError: dlopen(/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/base.so, 2): no suitable image found.  Did find:
    /Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/base.so: mach-o, but wrong architecture

OS X 10.6.3, Python 2.6.1, numpy 1.4.1, pygame 1.9.1

@pavellishin
Copy link

Nevermind, grabbed the latest version and everything is gravy.

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

No branches or pull requests

2 participants