Python 3.2.3,easy_install,Mac OS X [英] Python 3.2.3, easy_install, Mac OS X

查看:91
本文介绍了Python 3.2.3,easy_install,Mac OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Windows 7用户,请原谅我的无知.我一直在尝试帮助我的朋友在她的Mac OS X笔记本电脑上进行easy_install工作.我们在终端中使用以下命令设法使所有功能都适用于2.7:

I am a windows 7 user, so pardon me for my ignorance. I have been trying to help my friend get easy_install working on her Mac OS X laptop. We managed to get everything working for 2.7 with these commands in the terminal:

python distribution_setup.py(安装"distribute")

python distribute_setup.py (which installs "distribute")

easy_install

easy_install

我们为Python 3.2.3尝试了同样的事情:

We tried the same thing for Python 3.2.3:

python3.2 Distribution_setup.py

python3.2 distribute_setup.py

easy_install

easy_install

但是该软件包是为python 2.7而不是3.2.3安装的.据我所知,这是因为easy_install仅适用于2.7.

But the package gets installed for python 2.7 instead of 3.2.3. From what I know, this is because easy_install only works with 2.7.

在Windows 7上,我设法进入命令提示符python32目录并执行以下所有操作:

On my windows 7, I managed to do all these by going into the command prompt, python32 directory and doing:

python Distribution_setup.py

python distribute_setup.py

然后进入python32/script目录并直接运行easy_install.exe:

Then going into the python32/script directory and running easy_install.exe directly:

easy_install

easy_install

这会毫无问题地将软件包安装到python 3.2.3.

This installs the package to python 3.2.3 with no problems.

问题:

对于Mac OS X,我们应该做什么?Mac是否具有运行"easy_install.exe"的等效功能?

What should we be doing for Mac OS X? Is there a Mac equivalent of running "easy_install.exe"?

推荐答案

您已经完成了正确的第一步 python3.2 Distribution_setup.py .那应该已经为您的python3.2安装了 easy_install 的版本.现在,您实际上需要使用该 easy_install 命令,而不是OS X预先为系统Python安装的命令.如果您仍然有上述命令的输出,或者再次运行该命令,则在结尾附近,您应该会看到两行,如下所示:

You've done the right first step, python3.2 distribute_setup.py. That should have installed a version of easy_install for your python3.2. Now you need to actually use that easy_install command rather than the ones that come pre-installed with OS X for the system Pythons. If you still have the output from the above command or if you run the command again, near the end you should see two lines like this:

Installing easy_install script to /Library/Frameworks/Python.framework/Versions/3.2/bin
Installing easy_install-3.2 script to /Library/Frameworks/Python.framework/Versions/3.2/bin

这些位置是从python.org下载的OS X Python3.2的位置,对于其他版本,您可能还会看到其他位置.该目录显示了 easy_install 脚本的安装目录.您可以使用绝对路径执行脚本:

Those locations are for the OS X Python3.2 downloaded from python.org, you might see something else for other versions. That shows the directory where the easy_install scripts were installed. You could use an absolute path to execute the script:

/Library/Frameworks/Python.framework/Versions/3.2/bin/easy_install ...

但这很不方便.如果您打算广泛使用Python3.2,则可以修改shell搜索 PATH 将此目录添加到其中.对于OS X上的大多数Shell:

but that's rather inconvenient. If you are planning to use Python3.2 extensively, you can modify your shell search PATH to add this directory to it. For most shells on OS X:

export PATH=/Library/Frameworks/Python.framework/Versions/3.2/bin:$PATH

您可以将其添加到外壳初始化文件中,例如〜/.bash_profile .如果安装了python.org Python 3.2,则只需双击/Applications/Python 3.2/Update Shell Profile.command 即可.之后您需要打开一个新的终端窗口才能看到更改.

You can add that to a shell initialization file, like ~/.bash_profile. If you installed the python.org Python 3.2, you can just double-click /Applications/Python 3.2/Update Shell Profile.command to do that for you. You will need to open an new terminal window afterwards to see the change.

这篇关于Python 3.2.3,easy_install,Mac OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆