Python Forum
pygame installation problems
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame installation problems
#6
(Oct-28-2023, 11:29 AM)neronhat Wrote:
(Dec-12-2018, 07:05 AM)Aikanwha Wrote: Are you by chance using "Begin to Code with Python" by Rob Miles?

I had the same error up until a few minutes ago, so I thought I'd drop you an answer in case you're still having this problem or for anyone who comes across this thread.

After searching for way too long, I realized that snaps isn't something that comes with pygame or python.

- You have to go to their website at aka.ms/BeginCodePython/downloads
- Download their sample zip file, which contains the example programs from the book.
- Unzip the folder.
- Go into samples-master.
- Then "Ch 03 Python Program Structure".
- Finally there you will find the elusive snaps.py file.

copy this over to the same folder that holds the py file trying to import it, and it should work.

mine didn't work at first, until I closed the shell and relaunched it.

I hope this helps!
I want to ask, does that mean snaps is just a library written by someone? So it cannot be imported directly like official libraries like time, random,.. ? Think

Hi, I'm also using this book and the answer to your question is yes according to the author :
Quote:Snaps functions

The snaps library is a Python program file held in the same folder as the example pro-
grams for each chapter. The file contains all the functions we’ll use. If you want to use

snaps in another folder, simply copy the file snaps.py into the folder.
chapter 3 p66
And as Aikanwha said, to use it you need to download it and then put it in the same folder as your python file
RockBlok likes this post
Reply


Messages In This Thread
pygame installation problems - by Gheryk - May-17-2018, 01:14 PM
RE: pygame installation problems - by metulburr - May-17-2018, 05:13 PM
RE: pygame installation problems - by Aikanwha - Dec-12-2018, 07:05 AM
RE: pygame installation problems - by awaz - Mar-12-2020, 01:23 AM
RE: pygame installation problems - by neronhat - Oct-28-2023, 11:29 AM
RE: pygame installation problems - by E_Mohamed - Nov-29-2023, 08:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Problems with jump code in pygame Joningstone 4 5,471 Aug-23-2021, 08:23 PM
Last Post: deanhystad
  (HELP GREATLY APPRECIATED) New user- Huge Pygame Installation Problem! Jbomb 1 2,897 Jan-12-2021, 07:32 PM
Last Post: MK_CodingSpace
  [Pygame] Problems with my textbox SheeppOSU 1 3,147 May-27-2019, 12:03 AM
Last Post: metulburr
  [pygame] Inventory problems. Weapons equipped to wrong slot SheeppOSU 6 4,108 May-07-2019, 02:46 AM
Last Post: SheeppOSU
  drawing, moving, and collision problems (pygame) SheeppOSU 26 15,097 Apr-22-2019, 03:09 AM
Last Post: SheeppOSU
  Problems with loading buttons (pygame) SheeppOSU 2 3,179 Apr-12-2019, 08:04 PM
Last Post: SheeppOSU
  [PyGame] Why didn't my installation of pygame work? JohnJSal 4 4,554 Jul-01-2018, 08:26 PM
Last Post: JohnJSal
  [PyGame] Installation problems leap 4 6,884 Jan-09-2017, 11:26 PM
Last Post: leap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020