0

Well, here I am again. My unluck with python never seems to end... I am following the book, 'Python Programming for the Absolute Beginner' and I managed to use its '.bat' file thanks to you community. Turns out instead of:

setup.py
pause

the guy should have wrote:

python setup.py
pause

facepalm

I clicked on the .bat file and it did some code then asked to press enter to quit and such. I went on to python to try to use this, typing in:

from livewires import games, colors

which brings up this nasty error when ran in IDLE:

Traceback (most recent call last):
  File "C:/Python31/TESTERLY TEST", line 1, in <module>
    from livewires import games
  File "C:\Python31\lib\site-packages\livewires\games.py", line 57, in <module>
    import pygame, pygame.image, pygame.mixer, pygame.font, pygame.transform
  File "C:\Python31\lib\site-packages\pygame\__init__.py", line 95, in <module>
    from pygame.base import *
ImportError: DLL load failed: %1 is not a valid Win32 application.

I understand that these programs should not be ran in IDLE, but when I run it normally it just flicks away really quick cause the error.

Why does this happen? Please note that the fact that i spelled it 'color' is not the problem, as the guy seems to have edited to be american spelling. I'm British myself, so my first instinct is to write 'colour' but I tried both.

from livewires import games

seems to bring up a similar error.

Many thanks in advance.

Lixerman99
  • 151
  • 1
  • 2
  • 11

1 Answers1

0

This is a x32 vs x64 bit python problem. The python you're running is probably a 64-bit python (the version is written when you open the console).

Check if there's a 64 bit version for livewires and make sure you're using pygame for 64-bit. Or delete your python and install a 32-bit version (you can use it on a 64-bit OS) - there is more support (packages, etc) for 32-bit python.

Ella Sharakanski
  • 2,683
  • 3
  • 27
  • 47
  • Now this is getting real weird! I downloaded the x32 option and installed pygame, which i tested and got no errors on IDLE or when properly running. I then got livewires. However, when i did `from livewires import games, colors' IDLE came up with no errors, but the proper running console thing did! It flicks away to quick to see the error though. – Lixerman99 Apr 22 '15 at 15:18
  • Hmm... this needs it's own post. I'll post a link if i can if you wanna check it out. – Lixerman99 Apr 22 '15 at 15:31
  • To see the error, open an cmd console, and then do `python my_script.py` to run your script and keep the window open – Ella Sharakanski Apr 22 '15 at 15:37
  • Thanks! I recorded it and paused it to find out what it was though and now feel a bit dim. This will hopefully link you to it. http://stackoverflow.com/questions/29802629/python-livewires-console-error – Lixerman99 Apr 22 '15 at 15:50