Carglglz / jupyter_upydevice_kernel

Jupyter MicroPython Kernel made with upydevice
https://pypi.org/project/jupyter-micropython-upydevice/
BSD 3-Clause "New" or "Revised" License
14 stars 2 forks source link

ModuleNotFound on install #4

Open txoof opened 3 years ago

txoof commented 3 years ago

Python Version: Python 3.9.1 jupyter_upydevice_kernel version: 0.0.4

When running install command, to add the kernel spec I get the following:

$ python3 -m mpy_kernel_upydevice.install
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/mpy_kernel_upydevice/install.py", line 6, in <module>
    from jupyter_client.kernelspec import KernelSpecManager
ModuleNotFoundError: No module named 'jupyter_client'

Suggestions?

Carglglz commented 3 years ago

I think python3 may not be the same python in which jupyterlab is installed.

do $ which python3

and $ which pip3

$ which jupyter-lab To see if they are in the same path, then try to upgradejupyterlab

$ pip3 install --upgrade jupyterlab

And try again

$ python3 -m mpy_kernel_upydevice.install

The error

ModuleNotFoundError: No module named 'jupyter_client' is because there is no jupyterlab installed in that python (/usr/local/Cellar/python@3.9/3.9.1_8) installation.

txoof commented 3 years ago

I think I understand the problem now. I was trying to do this from within a pipenv virtual environement and I think that's probably borking things up.

$ which python3
/Users/aaronciuffo/.local/share/virtualenvs/pico-tests-pgUAtBHJ/bin/python3
$ which jupyter-lab
/usr/local/bin/jupyter-lab

I'm always a bit hesitant to add anything to the base python install and screw up some other project. I'll try it in a pyenv and see if that fixes it.