views:

1031

answers:

3

I get the following errors, I've placed [my name] for anonymity:

>>> python /Users/[myname]/Desktop/setuptools-0.6c11/ez_setup.py 
  File "<stdin>", line 1
    python /Users/[myname]/Desktop/setuptools-0.6c11/ez_setup.py 
                                                   ^
SyntaxError: invalid syntax

If you can't see the ^ is under the 11.

Or I get this error:

>>> python /Users/[myname]/Desktop/EZ_tutorial/ez_setup.py 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
+2  A: 

Try running that command from a shell (i.e. straight from Terminal.app), not from inside the python interpreter.

cobbal
I get the same error in the shell unfortunately
Diego
if you have a `>>>` you're in the python shell. Exit out of it using `quit()`.
cobbal
+1  A: 

The ez_setup.py script may or may not work depending on your environment. If not, follow the instructions here. In particular, from the shell, make sure that the python 2.6 you installed is now invoked by the command python:

$ python
Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

If not, modify your shell's PATH environment variable. Then download the setuptools 2.6 python egg from here, change to your brower's download directory, and run the downloaded script:

$ cd ~/Downloads   # substitute the appropriate directory name
$ sh setuptools-0.6c11-py2.6.egg
Ned Deily
I get the following error when trying your first recommendation: >>> sh setuptools-0.6c11-py2.6.eggSyntaxError: invalid syntax that is shown at 0.6c11 the second code you showed returned the following: NameError: name 'cd' is not defined
Diego
You are still trying to execute shell commands inside of the Python interpreter! The prompt you see should be something like `$` not `>>>`. Notice the `^D`: that means typing the `Control` and `D` keys simultaneously and that should return you to the shell.
Ned Deily
awesome, it worked. Thanks Ned!!
Diego
A: 

Ned's solution worked for me.