【问题标题】:spyder: edit keeps executing in python, not IPythonspyder:edit 继续在 python 中执行,而不是 IPython
【发布时间】:2018-02-06 11:19:05
【问题描述】:

我正在使用 spyder 3 运行 python,但不确定如何让我的会话运行 IPython。

我启动 spyder,然后单击控制台,然后选择“打开 IPython 控制台”。然后我在右下象限看到有一个 Python 和 IPython 控制台。我确保选择了 IPython 控制台。

然后我在编辑器中运行一些代码:

import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(10, 4))
print(df)

但是,当我按下 F5 时,我得到了回报:

NOTE: The Python console is going to be REMOVED in Spyder 3.2. Please start to migrate your work to the IPython console instead.

          0         1         2         3
0  0.383901 -1.021537  0.721708 -0.389721
1 -0.779638  0.010816  0.668723 -1.007539
2 -0.918172  1.100903  0.437585 -0.750007
3  0.822504 -2.546719  0.069220 -1.096228
4  1.040603  0.769918 -1.608101  0.279524
5  0.156436  0.518157 -1.278696  0.413262
6  0.211114  0.194401 -0.323856  0.988171
7  0.436519  0.611610 -1.027762  1.546440
8 -0.493041 -0.195899  0.616378 -0.135764
9 -0.355428  0.896633  0.535350  0.189172

我想在 IPython 中运行,但不确定我做错了什么或缺少一些基本的东西。关于如何让它在 IPython 中执行的任何想法?

仅供参考,我正在运行 Windows 10 并通过 anaconda 安装了 spyder。

谢谢。

【问题讨论】:

    标签: python ipython anaconda spyder


    【解决方案1】:

    在 Win7 上通过 anaconda 安装了 spyder。无法重现这种情况。

    你想知道的事情:-

    他们正在从 spyder 3.2 中删除 Python 控制台,并且只会出现 IPython 控制台。

    目前在 spyder 中没有选项可以在专用的 IPython 控制台中运行代码。这将在即将发布的版本中添加。

    你可以尝试什么:-

    转到 IPython 控制台并输入命令runfile("path_to_py_file",wdir="working_directory")

    然后按回车键。

    【讨论】:

    • 我升级了 spyder。谢谢。
    猜你喜欢
    • 2012-09-18
    • 2020-06-24
    • 2020-06-14
    • 1970-01-01
    • 2015-07-26
    • 1970-01-01
    • 2021-06-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多