Reputation: 341
I just installed Ubuntu to my computer, and I wanted to work on my .py project, so I did install Pyzo and Miniconda, and did a bunch of stuff to get Python3 and pygame. So, right now, it seems like Python is ok with importing pygame, but when the first line including some pygame comes in, there is an error.
Exemple :
ico = pygame.image.load('data\\png\\favicon.png').convert_alpha()
=>
pygame.error: Couldn't open data\png\favicon.png
By the way, it's working properly on all my other computers. And I'm running the file as a script, with the data folder in the same folder.
I tried to use Sublime Text 3, but I can't run anything 'cause my build is probably not good :
{
"cmd": ["/usr/bin/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"shell":"true"
}
EDIT :
I replaced all those "\\" in "/" and it works fine ! But Sublime Text still not working properly
Upvotes: 0
Views: 272
Reputation:
The load method should be like this:
ico = pygame.image.load('data/png/favicon.png').convert_alpha()
Also, this will only work if your path is correct, so double check it if it doesn't work.
Upvotes: 0