Repository: napari/napari

Issue:
In Napari Windows bundle console does not show
## 🐛 Bug
from https://napari.zulipchat.com/#narrow/stream/215289-release/topic/0.2E4.2E12.20bugfix.20release/near/258449904
```
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Programs\napari\\app\napari\utils\action_manager.py in ()
     51     def callable(self, context):
     52         if not hasattr(self, '_command_with_context'):
---> 53             self._command_with_context = lambda: call_with_context(
        global self._command_with_context = undefined
        global call_with_context = 
        global self.command = undefined
        global context = undefined
     54                 self.command, context
     55             )

~\AppData\Local\Programs\napari\\app\napari\utils\action_manager.py in call_with_context(function=>, context=)
     40     ]
     41     ctx = {k: v for k, v in context.items() if k in context_keys}
---> 42     return function(**ctx)
        function = >
        ctx = {}
     43 
     44 

~\AppData\Local\Programs\napari\\app\napari\_qt\qt_viewer.py in toggle_console_visibility(self=, event=None)
    735         """
    736         # force instantiation of console if not already instantiated
--> 737         _ = self.console
        _ = undefined
        self.console = undefined
    738 
    739         viz = not self.dockConsole.isVisible()

~\AppData\Local\Programs\napari\\app\napari\_qt\qt_viewer.py in console(self=)
    344                 with warnings.catch_warnings():
    345                     warnings.filterwarnings("ignore")
--> 346                     self.console = QtConsole(self.viewer)
        self.console = undefined
        QtConsole = 
        self.viewer = Viewer(axes=Axes(visible=False, labels=True, colored=True, dashed=False, arrows=True), camera=Camera(center=(0.0, 0.0, 0.0), zoom=1.0, angles=(0.0, 0.0, 90.0), perspective=0.0, interactive=True), cursor=Cursor(position=(1.0, 1.0), scaled=True, size=1, style=), dims=Dims(ndim=2, ndisplay=2, last_used=0, range=((0, 2, 1), (0, 2, 1)), current_step=(0, 0), order=(0, 1), axis_labels=('0', '1')), grid=GridCanvas(stride=1, shape=(-1, -1), enabled=False), layers=[], scale_bar=ScaleBar(visible=False, colored=False, ticks=True, position=, font_size=10.0, unit=None), text_overlay=TextOverlay(visible=False, color= (4,) float64, font_size=10.0, position=, text=''), help='', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='light', title='napari', mouse_move_callbacks=[], mouse_drag_callbacks=[], mouse_double_click_callbacks=[], mouse_wheel_callbacks=[], _persisted_mouse_event={}, _mouse_drag_gen={}, _mouse_wheel_gen={}, keymap={'Control-Shift-C': >})
    347                     self.console.push(
    348                         {'napari': napari, 'action_manager': action_manager}

~\AppData\Local\Programs\napari\\app_packages\napari_console\qt_console.py in __init__(self=, viewer=Viewer(axes=Axes(visible=False, labels=True, col...QtViewer(0x2050140a150) at 0x000002050214BE40>>}))
     90             # kernel.
     91             kernel_manager = QtInProcessKernelManager()
---> 92             kernel_manager.start_kernel(show_banner=False)
        kernel_manager.start_kernel = >
        global show_banner = undefined
     93             kernel_manager.kernel.gui = 'qt'
     94 

~\AppData\Local\Programs\napari\\app_packages\ipykernel\inprocess\manager.py in start_kernel(self=, **kwds={'show_banner': False})
     44     def start_kernel(self, **kwds):
     45         from ipykernel.inprocess.ipkernel import InProcessKernel
---> 46         self.kernel = InProcessKernel(parent=self, session=self.session)
        self.kernel = None
        InProcessKernel = 
        global parent = undefined
        self = 
        global session = undefined
        self.session = 
     47 
     48     def shutdown_kernel(self):

~\AppData\Local\Programs\napari\\app_packages\ipykernel\inprocess\ipkernel.py in __init__(self=, **traits={'parent': , 'session': })
     70 
     71     def __init__(self, **traits):
---> 72         super(InProcessKernel, self).__init__(**traits)
        global super = undefined
        global InProcessKernel = 
        self.__init__ = >
        traits = {'parent': , 'session': }
     73 
     74         self._underlying_iopub_socket.observe(self._io_dispatch, names=['message_sent'])

~\AppData\Local\Programs\napari\\app_packages\ipykernel\ipkernel.py in __init__(self=, **kwargs={'parent': , 'session': })
     87 
     88         # Initialize the InteractiveShell subclass
---> 89         self.shell = self.shell_class.instance(parent=self,
        self.shell = None
        self.shell_class.instance = >
        global parent = undefined
        self = 
        global profile_dir = undefined
        self.profile_dir = None
        global user_module = undefined
        self.user_module = None
        global user_ns = undefined
        self.user_ns = None
        global kernel = undefined
        global compiler_class = undefined
        global XCachingCompiler = 
     90             profile_dir = self.profile_dir,
     91             user_module = self.user_module,

~\AppData\Local\Programs\napari\\app_packages\traitlets\config\configurable.py in instance(cls=, *args=(), **kwargs={'compiler_class': , 'kernel': , 'parent': , 'profile_dir': None, 'user_module': None, 'user_ns': None})
    538         # Create and save the instance
    539         if cls._instance is None:
--> 540             inst = cls(*args, **kwargs)
        inst = undefined
        cls = 
        args = ()
        kwargs = {'parent': , 'profile_dir': None, 'user_module': None, 'user_ns': None, 'kernel': , 'compiler_class': }
    541             # Now make sure that the instance will also be returned by
    542             # parent classes' _instance attribute.

~\AppData\Local\Programs\napari\\app_packages\IPython\core\interactiveshell.py in __init__(self=, ipython_dir=None, profile_dir=None, user_module=None, user_ns=None, custom_exceptions=((), None), **kwargs={'compiler_class': , 'kernel': , 'parent': })
    680         # because the traceback handlers hardcode the stdout/stderr streams.
    681         # This logic in in debugger.Pdb and should eventually be changed.
--> 682         self.init_io()
        self.init_io = >
    683         self.init_traceback_handlers(custom_exceptions)
    684         self.init_prompts()

~\AppData\Local\Programs\napari\\app_packages\IPython\core\interactiveshell.py in init_io(self=)
    856         with warnings.catch_warnings():
    857             warnings.simplefilter('ignore', DeprecationWarning)
--> 858             io.stdout = io.IOStream(sys.stdout)
        global io.stdout = IPython.utils.io.IOStream()
        global io.IOStream = 
        global sys.stdout = None
    859             io.stderr = io.IOStream(sys.stderr)
    860 

~\AppData\Local\Programs\napari\\app_packages\IPython\utils\io.py in __init__(self= instance, stream=None, fallback=None)
     29                 stream = fallback
     30             else:
---> 31                 raise ValueError("fallback required, but not specified")
        global ValueError = undefined
     32         self.stream = stream
     33         self._swrite = stream.write

ValueError: fallback required, but not specified
```

## To Reproduce

Steps to reproduce the behavior:

1. install last bundle on windows
2. open napari
3. open console

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->
working console

## Environment
```
napari: 0.4.12rc1
Platform: Windows-10-10.0.19041-SP0
Python: 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
Qt: 5.15.2
PySide2: 5.15.2
NumPy: 1.19.3
SciPy: 1.7.1
Dask: 2021.09.1
VisPy: 0.9.1

OpenGL:
- GL version: 4.6.0 NVIDIA 456.71
- MAX_TEXTURE_SIZE: 32768

Screens:
- screen 1: resolution 2560x1440, scale 1.0
- screen 2: resolution 1920x1080, scale 1.0
- screen 3: resolution 1920x1080, scale 1.0

Plugins:
- console: 0.0.4
- scikit-image
- svg: 0.1.5
```

## Additional context

<!-- Add any other context about the problem here. -->



Discussion:
Console work when start napari from terminal (with command `python.exe -m napari`)

![napari](https://user-images.githubusercontent.com/3826210/138185620-b1fab580-b462-490c-a53b-1ce22f90790c.png)


Resolving patch:
diff --git a/bundle.py b/bundle.py
--- a/bundle.py
+++ b/bundle.py
@@ -263,7 +263,9 @@ def bundle():
 
         add_site_packages_to_path()
 
-        if MACOS:
+        if WINDOWS:
+            patch_wxs()
+        elif MACOS:
             patch_python_lib_location()
 
         # build


Test patch: