最近在看一本《与孩子一起学编程》Warren Sande Carter Sande 。
此书用的python是2.5版本,我在leopard上安装的是3.5版本,当需要使用easygui时依照书中所说方式下载http://easygui.sourceforge.net
发现不能如书中所说将easygui.py拷贝到python目录即可,需要重新安装一下。
Installing EasyGui
- Download the archive file of your choice
- Unpack the archive file into a temporary directory
- In the temporary directory, locate the file called setup.py
- In a console window, at the command prompt, enter the command:
python setup.py installIf you're using some form of Linux (e.g. Ubuntu) you may need to use the sudo command
sudo python setup.py installor something (depending on your version of Python) like this
sudo /usr/bin/python2.6 setup.py install网站如此介绍,唯独缺少leopard如何安装,下面我说一下:1、首先通过命令行进入到easygui.py那个目录2、然后在easygui.py目录下执行python3.5 setup.py install(你应是管理员权限,python3.5代表你目前安装的python版本)
3、最后再执行
python3.5 -m easygui即可。
检验一下是否安装成功,在IDLE下 执行>>>import easygui不出问题即可,同理类似安装可同理进行。祝玩的开心!