lmcinnes / lmcinnes/pynndescent

DistributionNotFound: The 'pynndescent' distribution was not found and is required by the application

Open
#144 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
970
Forks
107
PR merge metrics
No merged PRs in 30d

Description

Using python 3.8.10 with umap-learn 0.5.0, scanpy 1.8.1, pynndescent 0.5.2+computecanada, numba 0.51.2, llvmlite 0.34.0+computecanada.
And, I am running sc.pp.neighbors() from scanpy module. (on computecanada server)
By the way, I am using Mac os.
And, this is the error I got, below:


DistributionNotFound Traceback (most recent call last)
/tmp/ipykernel_30555/956378397.py in
----> 1 sc.pp.neighbors(aAMLallsc, n_neighbors = 6, n_pcs =3)

~/.local/lib/python3.8/site-packages/scanpy/neighbors/init.py in neighbors(adata, n_neighbors, n_pcs, use_rep, knn, random_state, method, metric, metric_kwds, key_added, copy)
137 adata._init_as_actual(adata.copy())
138 neighbors = Neighbors(adata)
--> 139 neighbors.compute_neighbors(
140 n_neighbors=n_neighbors,
141 knn=knn,

~/.local/lib/python3.8/site-packages/scanpy/neighbors/init.py in compute_neighbors(self, n_neighbors, knn, n_pcs, use_rep, method, random_state, write_knn_indices, metric, metric_kwds)
806 # we need self._distances also for method == 'gauss' if we didn't
807 # use dense distances
--> 808 self._distances, self._connectivities = _compute_connectivities_umap(
809 knn_indices,
810 knn_distances,

~/.local/lib/python3.8/site-packages/scanpy/neighbors/init.py in compute_connectivities_umap(knn_indices, knn_dists, n_obs, n_neighbors, set_op_mix_ratio, local_connectivity)
385 # umap 0.5.0
386 warnings.filterwarnings("ignore", message=r"Tensorflow not installed")
--> 387 from umap.umap
import fuzzy_simplicial_set
388
389 X = coo_matrix(([], ([], [])), shape=(n_obs, 1))

~/.local/lib/python3.8/site-packages/umap/init.py in
1 from warnings import warn, catch_warnings, simplefilter
----> 2 from .umap_ import UMAP
3
4 try:
5 with catch_warnings():

~/.local/lib/python3.8/site-packages/umap/umap_.py in
45 )
46
---> 47 from pynndescent import NNDescent
48 from pynndescent.distances import named_distances as pynn_named_distances
49 from pynndescent.sparse import sparse_named_distances as pynn_sparse_named_distances

~/.local/lib/python3.8/site-packages/pynndescent/init.py in
6 numba.config.THREADING_LAYER = "workqueue"
7
----> 8 version = pkg_resources.get_distribution("pynndescent").version

~/jupyter_py3/lib/python3.8/site-packages/pkg_resources/init.py in get_distribution(dist)
480 dist = Requirement.parse(dist)
481 if isinstance(dist, Requirement):
--> 482 dist = get_provider(dist)
483 if not isinstance(dist, Distribution):
484 raise TypeError("Expected string, Requirement, or Distribution", dist)

~/jupyter_py3/lib/python3.8/site-packages/pkg_resources/init.py in get_provider(moduleOrReq)
356 """Return an IResourceProvider for the named module or requirement"""
357 if isinstance(moduleOrReq, Requirement):
--> 358 return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
359 try:
360 module = sys.modules[moduleOrReq]

~/jupyter_py3/lib/python3.8/site-packages/pkg_resources/init.py in require(self, *requirements)
899 included, even if they were already activated in this working set.
900 """
--> 901 needed = self.resolve(parse_requirements(requirements))
902
903 for dist in needed:

~/jupyter_py3/lib/python3.8/site-packages/pkg_resources/init.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
785 if dist is None:
786 requirers = required_by.get(req, None)
--> 787 raise DistributionNotFound(req, requirers)
788 to_activate.append(dist)
789 if dist not in req:

DistributionNotFound: The 'pynndescent' distribution was not found and is required by the application

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the import failure in the stated Python 3.8 environment, then inspect pynndescent/init.py and the installed package metadata involved in pkg_resources.get_distribution. Done means importing pynndescent no longer raises DistributionNotFound when scanpy calls sc.pp.neighbors().

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.