`conda list` shows package not in `pip list`

When I run conda list jupyterlab, it lists:

Name Version Build Channel
jupyterlab 4.0.9 pypi_0 pypi

When I run pip uninstall jupyterlab, it says:

Ignoring invalid distribution -upyterlab (c:\programdata\anaconda3\envs\pandas\lib\site-packages)
Skipping jupyterlab as it is not installed.

So how can I uninstall jupyterlab from conda list? Thanks.

if jupyterlab was installed by conda, it should be uninstalled by conda:

conda uninstall jupyterlab

NOTE: conda is a layer on top of the “native” installer – e.g. pip in the case of most Python packages – so you may be able to use pip to uninstall, but it may break the conda environment, because conda won’t know that it isn’t there anymore.

In short – use conda for EVERYTHING YOU POSSIBLY CAN – and only use pip for a few packages that are not available via conda – and they should not be dependencies for anything else.

you may be able to use pip to uninstall, but it may break the conda environment, because conda won’t know that it isn’t there anymore.

Oh, I’ve been improperly choosing pip commands when an existing package’s channel was installed from pypi. Now I’m trying to uninstall jupyterlab so I can install properly with conda.

When I ran conda uninstall jupyterlab, it showed a PackagesNotFoundError. In Anaconda Navigator, I tried to uninstall jupyterlab and received the same error.

In Anaconda Navigator’s refreshed list of packages, I install jupyterlab 4.0.10 from conda-forge. When I run conda list jupyterlab again though, it still shows the previous version from pypi. How can I refresh conda list? Thanks.

“…it still shows the previous version from pypi.”

That conda list result could suggest that it was installed into the user site. Conda generally discourages any use of the --user flag when doing pip install to avoid this altogether. If you want to follow that guidance, one would delete all ~/.local/lib/python* (Unix) folders. One can check where user site is by running

python -m site --user-site

There are more options discussed in the StackOverflow thread, “Unexpected Python paths in Conda environment.”

1 Like

Because I encountered a previous issue with conda, I searched my environment folder for any files named jupyterlab*. Deleting such files has corrected conda list. So I believe that conda list also mistakes cached files (left after pip uninstall) too.