Skip to content

Automatically executing code at console startup seems broken #126

@Khris777

Description

@Khris777

Problem Description

In the settings under the IPython tag there is the section "Start" where you can enter code that should be executed automatically when starting a new console.

Apparently the code added there is not properly executed when starting a new console, it seems like only parts of it are executed with a bit of randomness involved:

What steps reproduce the problem?

Add different imports to the Ipython start field in the settings, then start new console. These are my results:

  • import sys, import os -> os imported, sys not imported.

  • import sys, import os, import shutil ->os and shutil imported, sys not imported

  • import os, import shutil, import sys -> Only os imported, sys and shutil not imported.

  • import random, import numpy, import sys, import os, import shutil -> everything but sys imported

  • import pandas as pd,pd.set_option('display.max_columns',25) -> pandas imported, setting not set (still at default value 0).

Generally it seems that mostly sys is not imported if it's there while other modules rarely have an issue.

My main issue is with pandas being imported but the following set_option()-call not being executed.

What is the expected output? What do you see instead?

Everything in the autostart field should be imported and executed.

Versions

  • Spyder version: 3.3.6
  • Python version: 3.7.3 64-bit
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10

Dependencies

IPython >=4.0     :  7.6.1 (OK)
cython >=0.21     :  0.29.12 (OK)
jedi >=0.9.0      :  0.13.3 (OK)
matplotlib >=2.0.0:  3.1.0 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
numpy >=1.7       :  1.16.4 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pyflakes >=0.6.0  :  2.1.1 (OK)
pygments >=2.0    :  2.4.2 (OK)
pylint >=0.25     :  2.3.1 (OK)
qtconsole >=4.2.0 :  4.5.1 (OK)
rope >=0.9.4      :  0.14.0 (OK)
sphinx >=0.6.6    :  2.1.2 (OK)
sympy >=0.7.3     :  1.4 (OK)

Metadata

Metadata

Assignees

Labels

type:BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions