【問題】
折騰:
過程中,安裝完畢PyScripter后,啟動出錯:
Python could not be properly initialized. We must quit.
【解決過程】
1. 由於我當前已經安裝的Python版本是2.7.2的,所以,后來從啟動菜單中,找到了PyScripter for 2.7的,打算去試試:
結果錯誤依舊。
2.順便去看了看,對應的實現機制,得知,上述不同的快捷方式,是在啟動時,添加了對應的參數:
3.看到:
How do I make PyScripter work? Says it cant find python26.dll
中的解釋,說是PyScripter,對於:
64位的系統(win7),必須安裝32位的Python,然后才可以使用PyScripter的:
If you are using a 64bit version of Windows note that PyScripter will only work if a 32bit version of Python is installed.
如果是真的,那么真的有夠變態。
4. 另外,看到開源中國:
也是這么說:
PyScripter只能使用 32位的 Python版本。
5.參考官網的issue:
Issue 643: Can’t start PyScripter
中的解釋是,64位的PyScripter,必須搭配64位的Python用。
而我這里,去啟動Python shell(command line)后發現,我這里不是64位,而是32位的:
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
所以,看來,貌似我應該去重新安裝64位的Python才對。
6.然后去從Python主頁,找到了x64的Python 2.7.3:
Python 2.7.3 Windows X86-64 Installer
http://www.python.org/ftp/python/2.7.3/python-2.7.3.amd64.msi
下載。
再去卸載掉原先的Python 2.7.2 32bit,再去安裝此Python 2.7.3 64bit。
7.安裝之后,去確認一下,的確是64位了:
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
然后再去運行PyScripter for Python 2.7,看看結果。
終於可以正常運行了:
【總結】
目前最新的PyScripter,是支持64位的。
正常的邏輯是:
- 如果你安裝了32位的Python,那么需要安裝對應的32位的PyScripter;
- 如果你安裝了64位的Python,那么需要安裝對應的64位的PyScripter;
1. 如何檢測Python是32位還是64位
開始->Python 2.7-> Python (command line) -> 可以看到:
- Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
- Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
等字樣,其中就顯示了是32 bit還是64 bit;
2.如何確定PyScripter是32位還是64位
下載PyScripter的時候,選擇的是32位還是64位:
http://code.google.com/p/pyscripter/downloads/list
中的:
總之,Python和PyScripter的版本要互相匹配才行。