Open yjkweon24 opened 3 years ago
~/.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)
Looking at these two lines, it appears that python suddenly found a different site-packages
directory to look in, and in that directory pynndescent
is not installed. I'm not sure how that could happen but it seems like an environment issue.
Something similar is happening in google colab:
Huh I've never seen dist-packages
before, I guess that's a Debian thing. At least in this case it's only looking in one location. Perhaps pynndescent
was installed to site-packages
?
the strange thing is if you run it again and again eventually it works...
maybe it can be switched to something like this?
Ah, something like #137 ? 🙂
@jamestwebber YES! Would strongly favor this to get in + release :)
Sadly I do not have the power and @lmcinnes is a busy guy, but hopefully he can merge it before the next release.
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, localconnectivity) 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, catchwarnings, 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