Setting Up Pygame for in VS Code

Pygame in VS Code

       1. I made a new folder 

          I already had VS Studio and python set up in system. So, that is not included here.

    C:\Users\DIVYA\Documents\MyGames\FirstGame

    I opened terminal.




        2.     Now Visual studio is opened


            3.Made new file main.py and ran python code.




                             Working fine.


4. Downloaded pygame library


            Since, python -m pip install pygame" didn't worked

Now downloaded pygame library. From website. 

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame



Searched pygame on page and downloaded second package (my system is 64 bit and AMD Ryzen 5 )  



5. Saved it to new folder. And opened terminal for that location. 




Used command “python -m pip install ./pygame-2.1.2-cp311-cp311-win_amd64.whl”

6. Now it still ran error

Module 'pygame' has no 'init' member

        Now to correct it. As I have to add following in user setting
         i.e. settings.jason 
        


                    "python.linting.pylintArgs": [

                                "--extension-pkg-whitelist=pygame",

                           "--erros-only"

                        ]


Pasted pygame code.

                


It ran successfully.



 


Comments