question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing the module breaks the interpreter

See original GitHub issue

When 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:open
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
gnebehaycommented, Mar 30, 2018

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.

0reactions
wRARcommented, Dec 12, 2021

I think this has been fixed, probably in 0.13.7?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found