I can't Import pygame!

This is the place for queries that don't fit in any of the other categories.

I can't Import pygame!

Postby Hissing Cockroach » Sat Sep 14, 2013 2:53 pm

Whenever I type "import pygame" in one of my programs,
all it does when I click on it is pop up the command line and
immediately disappear. For "import pygame" to actually work,
I think I'm suppost to put it in a certain folder or something,
but I have no idea.
Last edited by Yoriz on Sat Sep 14, 2013 3:54 pm, edited 1 time in total.
Reason: First post lock
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: I can't Import pygame!

Postby Wommbatt » Sat Sep 14, 2013 8:21 pm

I'm pretty sure the problem is that your script contains ONLY "import pygame". This means that after pygame is imported the program has reached the end of its script and closes the window. Add something like:
Code: Select all
input("Press enter to continue.")

If you want it to stay open.

I'm still pretty new to this myself, but I'm pretty sure that's all your problem is.

-wommbatt
Wommbatt
 
Posts: 24
Joined: Thu Jun 13, 2013 2:15 pm

Re: I can't Import pygame!

Postby Hissing Cockroach » Sat Sep 14, 2013 11:17 pm

Well, actually, it's a full program. and by trying to read the
letters on the disappearing screen, I made out:

'Traceback (most recent call last):
File "<stdin>" line 1, in <module>
ImportError: no module named pygame

Sorry I didn't mention that before.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: I can't Import pygame!

Postby stranac » Sun Sep 15, 2013 8:28 am

You should really be running programs from a terminal.
That would make it possible for you to see error messages.

Hissing Cockroach wrote:Traceback (most recent call last):
File "<stdin>" line 1, in <module>
ImportError: no module named pygame

Sounds like you don't have pygame.
Have you installed it?
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1137
Joined: Thu Feb 07, 2013 3:42 pm

Re: I can't Import pygame!

Postby Hissing Cockroach » Mon Sep 16, 2013 2:17 am

I think so, but I installed it from a disk that someone gave me, and
I don't know if the actual pygame was on there. Maybe I should download
it again from the internet. You know where to to go?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: I can't Import pygame!

Postby metulburr » Mon Sep 16, 2013 7:44 am

According to pygame's IRC channel, pygame.org has encounterred a hard disk failure. In the time being though you can use the archives to navigate around pygame's website.
http://web.archive.org/web/201308092128 ... load.shtml
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1455
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: I can't Import pygame!

Postby Hissing Cockroach » Mon Sep 16, 2013 9:30 pm

It works! Thanks!
I've finally got an answer!
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: I can't Import pygame!

Postby Somelauw » Tue Sep 17, 2013 6:47 pm

Hissing Cockroach wrote:It works! Thanks!
I've finally got an answer!


Could you please post the answer in case we want to help someone else in the future having the same problem?
Join the #python-forum IRC channel on irc.freenode.net!
Somelauw
 
Posts: 71
Joined: Tue Feb 12, 2013 8:30 pm

Re: I can't Import pygame!

Postby Hissing Cockroach » Wed Sep 18, 2013 12:08 am

read the comment above my last one
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 3 guests