Importing the module breaks the interpreter
See original GitHub issueWhen the module is imported in the python interpreter, which can be done not only explicitly, but also just by doing e.g. help(modules)
, some kind of ipython
shell replaces the interpreter. If that can be avoided it is a good thing to do.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
PyCharm error: 'No Module' when trying to import own module ...
When the interpreter executes the import statement, it searches for x.py in a list of directories assembled from the following sources:.
Read more >How to Fix PyCharm Import Error and Setup Your Interpreter
This will show you how to fix common pycharm import errors when trying to import python modules. Please watch through the entire video...
Read more >(Re)Importing in python - don't touch sys.modules - Justus Adam
As we have seen deleting entries in sys.modules causes the interpreter to reload modules in import statements, but why is that and what...
Read more >Tutorial - Python 3 basics Import Modules - PyLessons
When the Python interpreter encounters an import statement, it imports the module if the module is present in the search path.
Read more >How Python Finds Imported Modules | Webucator
The Python interpreter must locate imported modules. Where does it look for them? When import is used within a script, the interpreter searches...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is actually due to my IPython profile, where I use the package to autoreload files while I am using the IPython shell. These are the relevant settings: https://github.com/gnebehay/common/blob/master/dotfiles/.ipython/profile_default/ipython_config.py I don’t think that this package can swap code on-the-fly during debugging, but maybe there are other packages for this purpose.
I think this has been fixed, probably in 0.13.7?