I am having a basic problem with pygame
. I want to load a simple image given in tutorial for the package.
import pygame
catImg = pygame.image.load('cat.png')
and get the following error :
error: File is not a Windows BMP file
I saw this question asked countless times with answers to reinstall pygame
and install image packages (PIL
, Pillow
) . I tried all of those but it still does not work.
I have reinstalled pygame a lot of times by now and it still does not support more formats.
>>pygame.image.get_extended()
>> 0
I am using Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 5 2017, 02:28:52)
I installed PIL, Pillow
with conda
.
OSX is Mac OSX High Sierra 10.13.14
.
$type python
python is hashed (/Users/username/anaconda2/bin/python)
and I simply do :
$ python
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 5 2017, 02:28:52)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
>>> pygame.image.load('cat.png')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pygame.error: File is not a Windows BMP file
or do the same in jupyter
and the result is same.
$ python -V
Python 2.7.14 :: Anaconda custom (64-bit)