我试图运行这个tutorial,它在“导入cell2location”(单元格3,第15行)上给出了以下错误
DistributionNotFound: The 'pynndescent' distribution was not found and is required by the application
站点软件包文件夹位于/usr/local/lib/python3.6中,并且已成功安装“pynndescent”。setup_colab.sh脚本用于安装所有依赖项。剧本的内容是,
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local
conda install -q -y --prefix /usr/local python=3.6 numpy pandas jupyter leidenalg python-
igraph scanpy louvain hyperopt loompy cmake nose tornado dill ipython bbknn seaborn
matplotlib request mkl-service pygpu theano --channel bioconda --channel conda-forge
pip install -q --prefix /usr/local plotnine pymc3
git clone https://github.com/BayraktarLab/cell2location.git cell2location_repo
cd cell2location_repo && pip install -q --prefix /usr/local .
脚本的输出可以在上面提供的colab链接中的cell1的输出中看到。完整的错误日志是
---------------------------------------------------------------------------
DistributionNotFound Traceback (most recent call last)
<ipython-input-3-4cbed22293b5> in <module>()
13 #os.environ["THEANO_FLAGS"] = 'device=cpu,floatX=float32,openmp=True,force_device=True'
14
---> 15 import cell2location
16
17 import matplotlib as mpl
8 frames
/usr/local/lib/python3.6/site-packages/cell2location/__init__.py in <module>()
----> 1 from .region.spatial_knn import spot_factors2knn
2 from .run_c2l import run_cell2location
3 from .run_regression import run_regression
4 from .run_colocation import run_colocation
5
/usr/local/lib/python3.6/site-packages/cell2location/region/spatial_knn.py in <module>()
3 from scipy.spatial import cKDTree
4 from sklearn.neighbors import KDTree
----> 5 from umap.umap_ import fuzzy_simplicial_set
6
7
/usr/local/lib/python3.6/site-packages/umap/__init__.py in <module>()
1 from warnings import warn, catch_warnings, simplefilter
----> 2 from .umap_ import UMAP
3
4 try:
5 with catch_warnings():
/usr/local/lib/python3.6/site-packages/umap/umap_.py in <module>()
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
/usr/local/lib/python3.6/site-packages/pynndescent/__init__.py in <module>()
6 numba.config.THREADING_LAYER = "workqueue"
7
----> 8 __version__ = pkg_resources.get_distribution("pynndescent").version
/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py in get_distribution(dist)
464 dist = Requirement.parse(dist)
465 if isinstance(dist, Requirement):
--> 466 dist = get_provider(dist)
467 if not isinstance(dist, Distribution):
468 raise TypeError("Expected string, Requirement, or Distribution", dist)
/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py in get_provider(moduleOrReq)
340 """Return an IResourceProvider for the named module or requirement"""
341 if isinstance(moduleOrReq, Requirement):
--> 342 return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
343 try:
344 module = sys.modules[moduleOrReq]
/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py in require(self, *requirements)
884 included, even if they were already activated in this working set.
885 """
--> 886 needed = self.resolve(parse_requirements(requirements))
887
888 for dist in needed:
/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
770 if dist is None:
771 requirers = required_by.get(req, None)
--> 772 raise DistributionNotFound(req, requirers)
773 to_activate.append(dist)
774 if dist not in req:
DistributionNotFound: The 'pynndescent' distribution was not found and is required by the application
我试着重新安装PynDescent,更新setuptools,正确设置PYTHONPATH,但没有成功。如何解决此错误
找到了解决办法。在setup_colab.sh工作之前运行
!pip install pynndescent
。有关更多信息,请参阅此issue on github相关问题 更多 >
编程相关推荐