0
votes

I just moved yesterday from Windows XP SP3 to Windows 7 Ultimate.I had a few python 2.7 files working as a test(my first game) witch build and compiled just fine on windows xp. After installing windows 7,i did uninstall and install Python 2.7 and Pygame and set up the path for python and that works in win cmd.But now,the same files will not compile on windows 7,giving me the error:'TypeError: Invalid background RGBA argument'.This error is showed to be in this line of code:

greetings = myriadProFont.render('HELLO:', 1, (0,0,255),None)

This is the first time in my game that a font renderer is called.As i said,it compiled fine in win xp but now...I did some google search and i could not find anything useful,just some discussion and no answers(just a sugestion that a value None is not accepted for background and i should remove it,which i couldn't do because a message box appeared saying '[Errno13] Permission denied 'C:/STE/classes.py' ).Help!

2
Firstly if you are having permissions errors changing your code, you obviously won't be able to debug anything, try running it as an administrator or obtaining permissions some other way. If removing the None argument does not work, your problem might be version related, pygame only has a 32-bit version so make sure you are running it with python 2.7 32-bit. - KSab

2 Answers

0
votes

I made it work without modifying anything in the code.

It's just that before I installed windows 7 (when I had windows XP SP3) I believe I installed pygame for windows for python 2.7.8 from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and not from the http://www.pygame.org

I'm not 100% sure but i think that's it.

So I uninstantiated pygame from Windows 7 (which I believe I installed from http://www.pygame.org site) and reinstalled pygame from http://lfd.uci.edu/~gohlke/pythonlibs/ pygame-1.9.2a0.win32-py2.7.exe and now it works without errors.

But I still can't modify the code if I want to because of the same permission denied error.

How to resolve this issue?

0
votes

I had the same issue and I fixed it by removing the "None" (last argument), so it becomes

greetings = myriadProFont.render('HELLO:', 1, (0,0,255))

default value of background is already set in the function definition itself ( refer pyGame doc) so its not a problem.

btw, i use pygame 1.9.1 release