How can I install Easy_Install for Python 2.6.4 in Mac OSX 10.4.11【转】

简介:

up vote

1

down vote

favorite


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

python easy-install

link|improve this question

edited Jan 28 '10 at 5:19


Adam Bernier

13.7k31325

asked Jan 28 '10 at 5:17


Diego

907


92% accept rate



Hi Diego, welcome to SO. When you need a monospace font, you can highlight your text and press ctrl-k. – Adam Bernier Jan 28 '10 at 5:20

2 Answers

active

oldest

votes

up vote

2

down vote

accepted

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

link|improve this answer

answered Jan 28 '10 at 8:54


Ned Deily

12.8k11120



I get the following error when trying your first recommendation: >>> sh setuptools-0.6c11-py2.6.egg SyntaxError: invalid syntax that is shown at 0.6c11 the second code you showed returned the following: NameError: name 'cd' is not defined – Diego Jan 29 '10 at 0:28


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 Jan 29 '10 at 1:20


awesome, it worked. Thanks Ned!! – Diego Jan 29 '10 at 2:45

欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 330987132 | Go:217696290 | Python:336880185 | 做人要厚道,转载请注明出处!
相关文章
|
5月前
|
Python
python 获取mac地址
python 获取mac地址
42 0
|
7月前
|
安全 Python
Mac Python升级
Mac Python升级
48 0
|
8月前
|
小程序 Linux 区块链
Python PyInstaller 打包成 Win、Mac 应用程序(app / exe)
Python PyInstaller 打包成 Win、Mac 应用程序(app / exe)
548 0
|
4月前
|
小程序 Linux 区块链
Python PyInstaller 打包成 Win、Mac 应用程序(app / exe)
Python PyInstaller 打包成 Win、Mac 应用程序(app / exe)
129 0
|
5天前
|
Python
干货文:在 Mac 中卸载 Python 的方式
干货文:在 Mac 中卸载 Python 的方式
12 1
|
20天前
|
Python Linux iOS开发
使用 Python 打印本机 Mac 地址
使用 Python 打印本机 Mac 地址
8 0
|
4月前
|
JSON JavaScript 前端开发
Mac系统Anaconda环境配置Python的json库
Mac系统Anaconda环境配置Python的json库
|
7月前
|
机器人 程序员 Linux
|
8月前
|
Shell Python
Mac Python 使用 pyenv 多版本管理
Mac Python 使用 pyenv 多版本管理
113 0
|
9月前
|
JSON 数据可视化 定位技术
python数据可视化开发(3):使用psutil和socket模块获取电脑系统信息(Mac地址、IP地址、主机名、系统用户、硬盘、CPU、内存、网络)
python数据可视化开发(3):使用psutil和socket模块获取电脑系统信息(Mac地址、IP地址、主机名、系统用户、硬盘、CPU、内存、网络)
196 0