最近在看一本《與孩子一起學編程》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 install
If you're using some form of Linux (e.g. Ubuntu) you may need to use the sudo command
sudo python setup.py install
or 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
不出問題即可,同理類似安裝可同理進行。
祝玩的開心!