Last updated 1 year ago
I have loaded my sprite png into Pyangelo, but I am getting an OSError saying that my image has not been loaded into the code. Is this a common error? And is there a way to fix this?
Are you able to share a link to your sketch? The most common issue is not having the exact spelling of the filename, or using the wrong file extension. We have also just implemented a change where instead of calling loadImage(), you should call Image() instead. The old loadImage() function will work for backwards compatibility.
Does the following line of code work for you?
hero = Image("/samples/images/PyAngelo.png")
Become a free member to post a comment about this question.
Jason Lu Posted 2 years ago
Same
Jeff Plumb from PingSkills Posted 2 years ago
Thanks for posting this question. A bug was introduced when the ability to preview images was added. The bug caused the image to be overwritten when it was viewed and then the Python code tab was clicked. This has been fixed now. If you have any missing images you'll need to delete the file from the editor, and then re-upload the image. This should resolve any issues. And any new sketches you create should be fine. Let me know if this fixes the problem and if you find any other issues. Sorry for the problems.
Ayaan a47 Posted 1 year ago
ok bro