NameError

Cai Gengyang gengyangcai at gmail.com
Thu Nov 24 09:00:20 EST 2016


CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame
-bash: import: command not found



On Thursday, November 24, 2016 at 1:22:56 PM UTC+8, Nathan Ernst wrote:
> I don't see anything in that output resembling an error, just a few
> warnings that some features may no be available.
> 
> Have you tried importing pygame after you did that? That's what'll prove
> one way or another that it worked.
> 
> Regards,
> Nate
> 
> On Wed, Nov 23, 2016 at 10:48 PM, Cai Gengyang <gengyangcai at gmail.com>
> wrote:
> 
> > Yea, using Mac
> >
> > Following the instructions here for Mac ---https://bitbucket.org/
> > pygame/pygame/issues/82/homebrew-on-leopard-fails-to-
> > install#comment-627494
> >
> > GengYang Cai CaiGengYangs-MacBook-Pro:~ CaiGengYang$ brew install python
> > ==> Installing dependencies for python: xz, pkg-config, readline, sqlite,
> > ==> Installing python dependency: xz
> > ==> Downloading https://homebrew.bintray.com/.
> > ../xz-5.2.2.yosemite.bottle.ta
> > ########################################################################
> > 100.0%
> > ==> Pouring xz-5.2.2.yosemite.bottle.tar.gz
> > 🍺 /usr/local/Cellar/xz/5.2.2: 91 files, 1.4M
> > ==> Installing python dependency: pkg-config
> > ==> Downloading https://homebrew.bintray.com/.
> > ../pkg-config-0.29.1_1.yosemit
> > ########################################################################
> > 100.0%
> > ==> Pouring pkg-config-0.29.1_1.yosemite.bottle.tar.gz
> > 🍺 /usr/local/Cellar/pkg-config/0.29.1_1: 10 files, 627.3K
> > ==> Installing python dependency: readline
> > ==> Downloading https://homebrew.bintray.com/.
> > ../readline-6.3.8.yosemite.bot
> > ########################################################################
> > 100.0%
> > ==> Pouring readline-6.3.8.yosemite.bottle.tar.gz
> > ==> Caveats
> > This formula is keg-only, which means it was not symlinked into /usr/local.
> >
> > OS X provides the BSD libedit library, which shadows libreadline.
> > In order to prevent conflicts when programs look for libreadline we are
> > defaulting this GNU Readline installation to keg-only.
> >
> > Generally there are no consequences of this for you. If you build your
> > own software and it requires this formula, you'll need to add to your
> > build variables:
> >
> > LDFLAGS: -L/usr/local/opt/readline/lib
> > CPPFLAGS: -I/usr/local/opt/readline/include
> >
> > ==> Summary
> > 🍺 /usr/local/Cellar/readline/6.3.8: 46 files, 2M
> > ==> Installing python dependency: sqlite
> > ==> Downloading https://homebrew.bintray.com/.
> > ../sqlite-3.13.0.yosemite.bott
> > ########################################################################
> > 100.0%
> > ==> Pouring sqlite-3.13.0.yosemite.bottle.tar.gz
> > ==> Caveats
> > This formula is keg-only, which means it was not symlinked into /usr/local.
> >
> > OS X provides an older sqlite3.
> >
> > Generally there are no consequences of this for you. If you build your
> > own software and it requires this formula, you'll need to add to your
> > build variables:
> >
> > LDFLAGS: -L/usr/local/opt/sqlite/lib
> > CPPFLAGS: -I/usr/local/opt/sqlite/include
> >
> > ==> Summary
> > 🍺 /usr/local/Cellar/sqlite/3.13.0: 10 files, 2.9M
> > ==> Installing python dependency: gdbm
> > ==> Downloading https://homebrew.bintray.com/.
> > ../gdbm-1.12.yosemite.bottle.t
> > ########################################################################
> > 100.0%
> > ==> Pouring gdbm-1.12.yosemite.bottle.tar.gz
> > 🍺 /usr/local/Cellar/gdbm/1.12: 18 files, 490.8K
> > ==> Installing python dependency: openssl
> > ==> Downloading https://homebrew.bintray.com/.
> > ../openssl-1.0.2h_1.yosemite.b
> > ########################################################################
> > 100.0%
> > ==> Pouring openssl-1.0.2h_1.yosemite.bottle.tar.gz
> > ==> Caveats
> > A CA file has been bootstrapped using certificates from the system
> > keychain. To add additional certificates, place .pem files in
> > /usr/local/etc/openssl/certs
> >
> > and run
> > /usr/local/opt/openssl/bin/c_rehash
> >
> > This formula is keg-only, which means it was not symlinked into /usr/local.
> >
> > Apple has deprecated use of OpenSSL in favor of its own TLS and crypto
> > libraries
> >
> > Generally there are no consequences of this for you. If you build your
> > own software and it requires this formula, you'll need to add to your
> > build variables:
> >
> > LDFLAGS: -L/usr/local/opt/openssl/lib
> > CPPFLAGS: -I/usr/local/opt/openssl/include
> >
> > ==> Summary
> > 🍺 /usr/local/Cellar/openssl/1.0.2h_1: 1,691 files, 12.0M
> > ==> Installing python
> > Warning: Building python from source:
> > The bottle needs the Apple Command Line Tools to be installed.
> > You can install them, if desired, with:
> > xcode-select --install
> >
> > ==> Downloading https://www.python.org/.../2.7.12/Python-2.7.12.tar.xz
> > ########################################################################
> > 100.0%
> > ==> Downloading https://bugs.python.org/file30805/issue10910-
> > workaround.txt
> > ########################################################################
> > 100.0%
> > ==> Patching
> > ==> Applying issue10910-workaround.txt
> > patching file Include/pyport.h
> > Hunk #1 succeeded at 713 (offset 14 lines).
> > Hunk #2 succeeded at 736 (offset 14 lines).
> > ==> ./configure --prefix=/usr/local/Cellar/python/2.7.12 --enable-ipv6
> > --dataroo
> > ==> make
> > /usr/local/share/python/easy_install mecurial
> >
> > brew install sdl
> > brew install sdl_mixer
> > brew install sdl_ttf
> > brew install sdl_image
> >
> > hg clone https://bitbucket.org/pygame/pygame
> > cd pygame
> > /usr/local/bin/python setup.py install
> >
> >
> > Does this work ?
> >
> >
> >
> >
> >
> >
> >
> > On Thursday, November 24, 2016 at 12:00:18 PM UTC+8, Thomas Nyberg wrote:
> > > On 11/23/2016 10:02 PM, Cai Gengyang wrote:
> > > > I tried to import pygame by using these commands
> > ------------------------------------------------https://www.
> > google.com.sg/#q=how+to+import+pygame
> > > >
> > > > but this is the error I got :
> > > >
> > > > CaiGengYangs-MacBook-Pro:~ CaiGengYang$ sudo apt-get install
> > python-pygame
> > > > sudo: apt-get: command not found
> > > >
> > > Judging by your prompt it looks like you're on a Mac. The apt-get
> > > program is installed on some Linux distributions (probably your
> > > instructions are for Ubuntu). Here are some istructions for installing
> > > pygame for a Macbook:
> > >
> > >       http://pygame.org/wiki/macintosh
> > >       http://florian-berger.de/en/articles/installing-pygame-
> > for-python-3-on-os-x/
> > >       https://jamesfriend.com.au/installing-pygame-python-3-
> > mac-os-yosemite
> > >
> > > Here's some info about getting a package manager like apt for Mac:
> > >
> > >       http://unix.stackexchange.com/questions/80711/how-to-
> > install-apt-get-or-yum-on-mac-os-x
> > >
> > > Hopefully this helps.
> > >
> > > Cheers,
> > > Thomas
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >



More information about the Python-list mailing list