Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'Protocol' from 'typing' #59

Open
hl-xue opened this issue Jul 6, 2023 · 1 comment
Open

ImportError: cannot import name 'Protocol' from 'typing' #59

hl-xue opened this issue Jul 6, 2023 · 1 comment

Comments

@hl-xue
Copy link

hl-xue commented Jul 6, 2023

Hello,

Thanks for the nice pipeline!

I am encountering some issues when running it on your test data.

I cloned your Github main branch and then manually commented the line

  - igraph<0.10

in envs/scib-pipeline-R4.0.yml following an error during installation and the instructions here.

But when I ran the workflow, I got this error:

ImportError: cannot import name 'Protocol' from 'typing'
Traceback (most recent call last):
  File "scripts/integration/runIntegration.py", line 67, in <module>
    runIntegration(file, out, run, hvg, batch, celltype)
  File "scripts/integration/runIntegration.py", line 22, in runIntegration
    integrated = method(adata, batch, celltype)
...

By looking into miniconda3/envs/scib-pipeline-R4.0/lib/python3.7/typing.py, I found a mentioning of:

* The public counterpart of the generics API consists of two classes: Generic and Protocol
  (the latter is currently private, but will be made public after PEP 544 acceptance).

Then I found here that the PEP 544 was supported since Python 3.8.

However, when I tried to change

- python>=3.7

to

- python>=3.8

in the envs/scib-pipeline-R4.0.yml and update the environment, I got a confliction

The following packages are incompatible
├─ bbknn 1.3.9**  is installable with the potential options
│  ├─ bbknn 1.3.9 would require
│  │  ├─ python >=2.7,<2.8.0a0 , which can be installed;
│  │  └─ python_abi 2.7.* *_cp27mu, which can be installed;
│  ├─ bbknn 1.3.9 would require
│  │  ├─ python >=3.6,<3.7.0a0 , which can be installed;
│  │  └─ python_abi 3.6.* *_cp36m, which can be installed;
│  └─ bbknn 1.3.9 would require
│     ├─ python >=3.7,<3.8.0a0 , which can be installed;
│     └─ python_abi 3.7.* *_cp37m, which can be installed;
└─ python >=3.8  is uninstallable because there are no viable options
   ├─ python [3.10.0|3.10.10|...|3.9.7] conflicts with any installable versions previously reported;
   ├─ python [3.10.0|3.10.1|...|3.10.9] would require
   │  └─ python_abi 3.10.* *_cp310, which conflicts with any installable versions previously reported;
   ├─ python [3.11.0|3.11.1|3.11.2|3.11.3|3.11.4] would require
   │  └─ python_abi 3.11.* *_cp311, which conflicts with any installable versions previously reported;
   ├─ python [3.8.0|3.8.1] would require
   │  └─ python_abi * *_cp38, which conflicts with any installable versions previously reported;
   ├─ python [3.8.10|3.8.12|...|3.8.8] would require
   │  └─ python_abi 3.8.* *_cp38, which conflicts with any installable versions previously reported;
   └─ python [3.9.0|3.9.1|...|3.9.9] would require
      └─ python_abi 3.9.* *_cp39, which conflicts with any installable versions previously reported.

Do you know how should I solve this please?
Also, I would suggest to have a pre-build docker or singularity image of this pipeline if possible, in which anyone can launch the benchmarking without package installation.

@skim245
Copy link

skim245 commented Sep 26, 2023

@hl-xue did you resolve this issue?
I also face the same error when I try to run the pipeline to include the methods: scanvi, scgen and scvi.
seems like the Protocol from typing is incompatible with Python 3.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants