如何在Mac OS X 10.6(Snow Leopard)上安装EasyGUI? [英] How to install EasyGUI on Mac OS X 10.6 (Snow Leopard)?

查看:108
本文介绍了如何在Mac OS X 10.6(Snow Leopard)上安装EasyGUI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Mac OS X 10.6上安装 EasyGUI ,但是遇到了麻烦.有人成功做到了吗?如果是这样,您遵循了哪些明确的步骤?

I would like to install EasyGUI on Mac OS X 10.6, but am running into trouble. Has anyone successfully done this? If so, what explicit set of steps did you follow?

谢谢.

推荐答案

很难知道 遇到麻烦 是什么意思,但是,类似这样的似乎适用于10.6:

It's hard to know what running into trouble means but, nonetheless, something like this seems to work on 10.6:

mkdir test_easygui
cd test_easygui
curl http://easygui.sourceforge.net/current_version/easygui_v0.93.tar.gz | tar xz
/usr/bin/python2.6 easygui.py

不幸的是,EasyGui下载不包含setup.py,它使您可以以常规Python方式轻松安装它.要成为Python世界中的好公民,应该这样做.幸运的是,很容易提供一个.在下载目录(上例中为test_easygui)中,创建以下文本文件并将其命名为setup.py:

Unfortunately, the EasyGui download does not include a setup.py that would allow you to easily install it in the normal Python manner. To be a good citizen in the Python World, it should. Fortunately, it is easy to supply one. In the download directory (test_easygui in the example above), create the following text file and name it setup.py:

from distutils.core import setup
setup(name='easygui',
      version='0.93',
      py_modules=['easygui'],
     )

然后运行以下命令:

sudo /usr/bin/python2.6 setup.py install

现在,您应该可以从以下任何目录运行演示了:

Now you should be able to run the demo from any directory by:

/usr/bin/python2.6 -m easygui

,您应该可以只在自己的python模块中使用import easygui.顺便说一句,此过程应在任何受支持的python平台(不仅是OS X)上,并已安装任何受支持的python解释器上运行:只需将/usr/bin/python2.6的正确路径替换为即可. (如果您在OS X 10.6上没有安装任何其他的python,则只需键入python就足够了.)

and you should be able to just import easygui in your own python modules. By the way, this process should work on any supported python platform (not just OS X) and with any supported python interpreter you have installed: just substitute the proper path for /usr/bin/python2.6. (If you don't have any extra pythons installed on OS X 10.6, typing just python should be sufficient.)

这篇关于如何在Mac OS X 10.6(Snow Leopard)上安装EasyGUI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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