我正在尝试安装python。或者实际上,现在已经安装和卸载了几次。我正在将 pythonxy 与 spyder IDE 一起使用(我习惯于 matlab 是我想使用 spyder 的原因)。在我的 win8 机器上,3.3.2 python 甚至不会以 spyder 启动,所以现在我安装了 2.7 版本。
Spyder 现在启动了,但启动时我得到''import sitecustomize' failed?在我的控制台中,python 不会执行我输入的任何命令。出现错误后,启动脚本会一直运行下去而没有做任何事情,我也不能再做任何事情了。该错误告诉我使用 -v 附录启动 python,输出如下。
我用谷歌搜索了这个错误,这给了我两个可能的解决方案:我应该编辑 python.rb https://github.com/mxcl/homebrew/commit/10ba101c323f98118b427f291e15abc5b3732991 或者我应该应用这个(最后一篇文章中的附件)到 sitecustomize https:// /code.google.com/p/spyderlib/issues/detail?id=771
应用 diff 文件没有帮助,正如 mata 在下面解释的那样,在安装过程中使用了 .rb 文件,因此不适用于我的问题。
所以我的问题是:有人知道如何从经验中修复这个错误吗?
错误:
'import sitecustomize' failed; use -v for traceback
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
追溯:
C:\Python27\lib\site-packages\spyderlib\pil_patch.pyc matches C:\Python27\lib\site-packages\spyderlib\pil_patch.py
import spyderlib.pil_patch # precompiled from C:\Python27\lib\site-packages\spyderlib\pil_patch.pyc
Traceback (most recent call last):
File "C:\Python27\lib\site.py", line 498, in execsitecustomize
import sitecustomize
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 174, in <module>
os.environ["SPYDER_AR_STATE"].lower() == "true")
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\monitor.py", line 146, in __init__
self.n_request.connect( (host, notification_port) )
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.