2
hitko
3y

So apparently jupyter / ipython adds the current workdir to kernel library path, and it crashes if you happen to have a file named something like "tokenize.py" in your workdir because it gets prioritised over ipython's builtin module with the same name. What a great design for something which is specifically made to run isolated chunks of code, that it can't even properly isolate itself from the workdir.

Comments
  • 2
    Oh, and I know exactly why this happens: Python sucks for importing things from relative path (https://stackoverflow.com/questions...), so to simplify the experience they decided to automatically add workdir to kernel path to solve this. And then they used the same kernel for both the underlying system and user code. It's an obvious hacky solution, like every single damn thing with Python.
Add Comment