简体   繁体   English

IDE的Python模块有所不同

[英]Python modules are different between IDE's

I am developing algorithms in python and mostly use IPython notebook, but when ever I need to debug I usually use Wing IDE. 我正在用python开发算法,并且大多使用IPython Notebook,但是每当需要调试时,我通常都使用Wing IDE。 I'm currently having a strange problem. 我目前遇到一个奇怪的问题。 In the notebook, I do have a method from the matplotlib package (subplot2grid) but in Wing, I do not have this method. 在笔记本中,我确实有一个来自matplotlib包(subplot2grid)的方法,但是在Wing中,我没有此方法。

most of my packages were installed with the installation of pythonXY. 我的大多数软件包都是通过pythonXY安装而安装的。 still i do not understand why wing is using a different matplotlib from IPython, and how something like that had happend in the first place (I dont think I installed matplotlib again beside from the pythonXY automatic installation). 仍然我不明白为什么wing使用的是不同于IPython的matplotlib,以及类似的事情是如何首先发生的(我不认为我从pythonXY自动安装之外再次安装了matplotlib)。

What is going on here? 这里发生了什么?

Wing looks for 'python' on the path or if none tries to find Python on your path or (on Windows) in the registry. Wing会在路径中寻找“ python”,或者如果没有人试图在路径中或注册表中(在Windows中)寻找Python。 Look at sys.executable in the IPython notebook and set Python Executable in Wing's Project Properties (from the Project menu) to that full path. 在IPython笔记本中查看sys.executable,并将Wing的Project Properties(从Project菜单)中的Python Executable设置为该完整路径。 Then the debugger should use the right Python. 然后,调试器应使用正确的Python。

Note that you'll need to restart the integrated Python Shell in Wing from its Options menu before that change takes effect there (Wing doesn't just automatically restart that, in case you have data or state there that you don't want to lose). 请注意,在更改生效之前,您需要从Wing的“选项”菜单中重新启动集成的Python Shell(Wing不会自动重新启动它,以防万一您有数据或声明不想丢失)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM