Spyder: Autoreload and opening of a dedicated console sometimes fails with modules in subfolder

Created on 19 Jul 2019  路  3Comments  路  Source: spyder-ide/spyder

Problem Description

Autoreload of modules and opening a dedicated console sometimes fails when I have a program that imports modules from a subfolder in the same directory. I enabled "execute in a dedicated console" and UMR in the preferences. I also did a complete reinstall of Anaconda and Spyder.

What steps reproduce the problem?

  1. I created a program "run_foo.py" and a folder "foo_folder" with a program "foo.py". The "run_foo.py" contains
    from foo_folder import foo
    if __name__ == '__main__': print(foo.bar())
    and the foo.py contains just
    def bar():
    return 'Hello World'
  2. I opened a new console and run the run_foo.py. I then changed the string in foo.py to something else, ran the run_foo.py again, then changed it back and ran it a third time.

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

The first output was "Hello World" as expected. I changed the string to "Goodbye World", it showed in the console that it reloaded the "foo.py" and gave the correct output. But when I changed it a third time, it still printed "Goodbye World" and did not reload the module or open a new dedicated console.

Is this somehow expected behaviour? Because I don't see the consistency here.
Also, this never happened when I imported modules from the same directory.

Paste Traceback/Error Below (if applicable)

no traceback or other errors

Versions

Versions:
Windows 10 Pro v 1803
Python 3.7.3
Spyder 3.3.6
IPython 7.6.1

IPython Console Bug

All 3 comments

@dalthviz, are you able to reproduce this one?

@ccordoba12 I was able to reproduce this:

reload

Great, thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ok97465 picture ok97465  路  3Comments

cchu08 picture cchu08  路  3Comments

impact27 picture impact27  路  3Comments

marianux picture marianux  路  3Comments

spyder-bot picture spyder-bot  路  3Comments