【转】PyScripter启动出错:Python could not be properly initialized. We must quit.

【问题】

折腾:

【记录】使用Python的IDE:PyScripter

过程中,安装完毕PyScripter后,启动出错:

Python could not be properly initialized. We must quit.

python could not be properly initialized we must quit_thumb

【解决过程】

1. 由于我当前已经安装的Python版本是2.7.2的,所以,后来从启动菜单中,找到了PyScripter for 2.7的,打算去试试:

try python 2.7_thumb

结果错误依旧。

2.顺便去看了看,对应的实现机制,得知,上述不同的快捷方式,是在启动时,添加了对应的参数:

cmd para 2.7 for 27

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. 另外,看到开源中国:

Python集成开发环境 pyScripter

也是这么说:

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,看看结果。

终于可以正常运行了:

run pyscripter for python2.7 ok

【总结】

目前最新的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的版本要互相匹配才行。

原文地址:https://www.cnblogs.com/hahawgp/p/3163625.html