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 | 做人要厚道,转载请注明出处!
相关文章
|
2月前
|
存储 网络安全 数据安全/隐私保护
|
2月前
|
机器学习/深度学习 Python
【10月更文挑战第5天】「Mac上学Python 6」入门篇6 - 安装与使用Anaconda
本篇将详细介绍如何在Mac系统上安装和配置Anaconda,如何创建虚拟环境,并学习如何使用 `pip` 和 `conda` 管理Python包,直到成功运行第一个Python程序。通过本篇,您将学会如何高效地使用Anaconda创建和管理虚拟环境,并使用Python开发。
73 4
【10月更文挑战第5天】「Mac上学Python 6」入门篇6 - 安装与使用Anaconda
|
2月前
|
NoSQL Shell MongoDB
Mac OSX 平台安装 MongoDB
10月更文挑战第11天
21 4
|
3月前
|
Python Windows
Python:执行py命令,提示: Can‘t find a default Python.
Python:执行py命令,提示: Can‘t find a default Python.
|
3月前
|
JSON 安全 数据格式
7-6|python报错TypeError: can't pickle _thread.RLock objects
7-6|python报错TypeError: can't pickle _thread.RLock objects
|
4月前
|
Linux 程序员 Python
python-office支持Mac和Linux吗?自动化办公用这个就够了
大家好,我是程序员晚枫。今天解答关于`python-office`是否支持Mac和Linux的问题。起初因需调用Office功能,该项目不完全支持这两个系统。现已通过拆分子项目解决了这一限制,例如`poexcel`可在多平台上运行Excel相关功能。只需简单修改导入语句,如使用`import poexcel`替代`import office`,即可在Mac和Linux上顺利执行。学习或使用中有任何疑问,欢迎留言交流!
|
4月前
|
JavaScript 前端开发 Python
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
这篇文章分享了作者在运行前端Vue项目时遇到的关于Python执行环境的问题和解决方法。问题是由于找不到Python可执行文件导致的编译错误,解决方法包括安装编译环境、卸载并重新安装出现问题的`node-sass`包,并重新执行`npm install`和`npm run dev`。
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
|
4月前
|
Python
Mac安装Python3.12开发环境
Mac安装Python3.12开发环境
154 2
|
4月前
Mac Brew install慢的问题
Mac Brew install慢的问题
61 1
|
4月前
|
Python
【Python】解决Can‘t find model ‘en‘. It doesn‘t seem to be a shortcut link, a Python package or a valid
在使用以下代码时,报错Can’t find model ‘en’. It doesn’t seem to be a shortcut link, a Python package or a valid path to a data directory.
63 1