0

Goal: use conda venv as Jupyter kernel.

I use the same conda venv as my kernel in the notebook. Yet, conda list is different.


PyCharm

(venv) me@me:~/PyCharm projects/project$ pip show Cytomine_Python_Client
Name: Cytomine-Python-Client
Version: 2.5.1
Summary: Python client to interact with Cytomine.
Home-page: https://www.cytomine.org
Author: None
Author-email: None
License: LICENSE
Location: /home/me/miniconda3/envs/venv/lib/python3.9/site-packages
Requires: urllib3, future, opencv-python-headless, requests, numpy, Shapely, Pillow, CacheControl, requests-toolbelt, six
Required-by: foo, bar

conda list

(venv) me@me:~/PyCharm projects/project$ conda list
# packages in environment at /home/me/miniconda3/envs/venv:
#
# Name                    Version                   Build  Channel
...
cytomine-python-client    2.5.1                    pypi_0    pypi

Notebook

pip show Cytomine_Python_Client
>>> WARNING: Package(s) not found: Cytomine_Python_Client
>>> Note: you may need to restart the kernel to use updated packages.
from cytomine.models import ImageInstanceCollection
>>> ModuleNotFoundError: No module named 'cytomine'

conda list

# packages in environment at /home/me/miniconda3:
#
# Name                    Version                   Build  Channel
...
<not here>

Let me know what else I should add to the post.

DanielBell99
  • 896
  • 5
  • 25
  • 57

1 Answers1

0

I hadn't used the right tool for the job; this error was a symptom.

I wanted to access an existing conda venv, used in PyCharm, in Jupyter Labs.

Solution:

(base)$ conda install -c conda-forge nb_conda_kernels

Source

DanielBell99
  • 896
  • 5
  • 25
  • 57