I'm currently making my first game in Python 3.5 with a friend for a school project.
We are using pygame, and it was working fine until I change my computer for Ubuntu 16. I installed PyCharm.
I could see that it was pointing that some things like pygame.init()
were flaged as "Cannot find reference 'init' in '__init__.py'"
.
I googled the message and it turned out it was a PyCharm bug with pygame.
But when I run my app, one of the warnings turns out not to be a bug : 'NoneType' object has no attribute 'music'
. So Python doesn't find the mixer module for pygame, though I wrote import pygame
in the concerned file :
import pygame
....
def play_music(self):
pygame.mixer.music.load(<mymusic>)
pygame.mixer.music.play()
Thank you for your help :)
-- EDIT -- I used print(pygame.mixer) to verify its value was None. I received :
<module 'pygame.mixer' from '/home/<myname>/.local/lib/python3.5/site-packages/pygame/mixer.cpython-35m-x86_64-linux-gnu.so'>