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

BUG:Installation error ImportError: cannot import name 'Protocol' #81

Closed
Unalibun opened this issue Apr 21, 2022 · 3 comments
Closed

BUG:Installation error ImportError: cannot import name 'Protocol' #81

Unalibun opened this issue Apr 21, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Unalibun
Copy link

Hello, I am trying to install predector with a conda environment in a linux server. However I am having a problem with some python packages and this is the error.

Traceback (most recent call last):
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/importlib_metadata/_compat.py", line 9, in
from typing import Protocol
ImportError: cannot import name 'Protocol'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/sandra.gonzalez/.conda/envs/predector/bin/deeploc", line 87, in
main(args.fasta, args.output, args.attention)
File "/home/sandra.gonzalez/.conda/envs/predector/bin/deeploc", line 44, in main
f_ids, f_loc, f_mem = prediction(ids, prot_seqs, batch_size)
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/DeepLoc/models.py", line 251, in prediction
deploy_fn1, network_out1 = net_tree()
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/DeepLoc/models.py", line 112, in net_tree
deterministic=True)
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/lasagne/layers/helper.py", line 197, in get_output
all_outputs[layer] = layer.get_output_for(layer_inputs, **kwargs)
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/lasagne/layers/recurrent.py", line 1120, in get_output_for
strict=True)[0]
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/theano/scan_module/scan.py", line 1006, in scan
from theano import gpuarray
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/theano/gpuarray/init.py", line 23, in
import pygpu
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/pygpu/init.py", line 7, in
from . import gpuarray, elemwise, reduction
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/pygpu/reduction.py", line 4, in
from mako.template import Template
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/mako/template.py", line 19, in
from mako import cache
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/mako/cache.py", line 7, in
from mako import util
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/mako/util.py", line 14, in
from .compat import importlib_metadata_get
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/mako/compat.py", line 68, in
import importlib_metadata # noqa
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/importlib_metadata/init.py", line 17, in
from . import _adapters, _meta
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/importlib_metadata/_meta.py", line 1, in
from ._compat import Protocol
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/importlib_metadata/_compat.py", line 16, in
from typing_extensions import Protocol # type: ignore
File "/home/sandra.gonzalez/.conda/envs/predector/lib/python3.6/site-packages/typing_extensions.py", line 159, in
class _FinalForm(typing._SpecialForm, _root=True):
AttributeError: module 'typing' has no attribute '_SpecialForm'

could you please to help me to solve it?

best

@Unalibun Unalibun added the bug Something isn't working label Apr 21, 2022
@darcyabjones
Copy link
Member

Hi @Unalibun!

Sorry for the late reply. I've been on leave and then I got sick.
It seems like there have been some dependency updates and some of the libraries have ditched support for python 3.6.
The Protocol type was introduced in Python 3.8.

I'll need a few days to figure out how to get all of the dependencies working in conda/mamba.

In the mean time if you are able to run the pipeline using docker or singularity you can avoid all of these issues.
I'll try to be quick though.

All the best,
Darcy

@darcyabjones
Copy link
Member

Hi @Unalibun !

Thanks again for reporting this.
This should now be resolved with version 1.2.6 #83
The new version that I've just released now uses python 3.9, so you shouldn't have this problem.

Sorry it's taken so long, it's a busy time :)

All the best,

Darcy

@Unalibun
Copy link
Author

Unalibun commented May 9, 2022

Dear @darcyabjones Thanks you so much for your messages and help, I will try the new update! All the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants