BayraktarLab / cell2location

Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics (cell2location model)
https://cell2location.readthedocs.io/en/latest/
Apache License 2.0
321 stars 58 forks source link

bug in installing in colab Pygments 2.6.1 Requirement.parse('pygments<3.0.0,>=2.14.0'), {'rich'}) #256

Open yuanmuqing2000 opened 1 year ago

yuanmuqing2000 commented 1 year ago

Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Minimal code sample (that we can run without your data, using public data)

I run the colab tutorial and the first part has error below. Then there is bug ‘Pygments2.6.1 (/usr/local/lib/python3.8/dist-packages), Requirement.parse('pygments<3.0.0,>=2.14.0'), {'rich'}' in "import cell2location". I tried 'pip install jedi==0.10' and it remains the same. It is the first time I put issue on github and it will be very nice if you provide help for me.

import sys
IN_COLAB = "google.colab" in sys.modules
if IN_COLAB:
    !pip install --quiet scvi-colab
    from scvi_colab import install
    install()
    !pip install --quiet git+https://github.com/BayraktarLab/cell2location#egg=cell2location[tutorials]

import scanpy as sc
import numpy as np
import matplotlib.pyplot as plt 
import matplotlib as mpl
import cell2location
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ipython 7.9.0 requires jedi>=0.10, which is not installed.
INFO     scvi-colab: Installing scvi-tools.                                                                        
INFO     scvi-colab: Install successful. Testing import.                                                           
WARNING  scvi-colab: Import unsuccessful. Try restarting (not resetting) the session and running again.            
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Building wheel for cell2location (pyproject.toml) ... done

(Pygments 2.6.1 (/usr/local/lib/python3.8/dist-packages), Requirement.parse('pygments<3.0.0,>=2.14.0'), {'rich'})
dr-michael-haley commented 1 year ago

I had a similar issue - I think its caused by pygments being installed twice. Restarting the runtime (Runtime -> Restart runtime) after you've installed the packages from pip, but before importing, may solve the issue.

I'm having some success skipping the installation of scvi-collab, and installing using only this command: !pip install cell2location[tutorials]

I can now successfully import cell2location and continue with the tutorial, but will report back if I find any other errors