Cryptic Errors Related to "compath_utils.models.CompathPathwayMixin" when running `pathme wikipathways bel`
Closed this issue · 14 comments
Hi there,
This packages seems really awesome thanks for building it! I'm running into errors in the initial setup however. First installing via python3 -m pip install git+https://github.com/PathwayMerger/PathMe.git
in a fresh conda environment I'm getting a number of version conflicts:
ERROR: compath-utils 0.3.2 has requirement bio2bel>=0.3.2, but you'll have bio2bel 0.2.1 which is incompatible. ERROR: compath-utils 0.3.2 has requirement pybel>=0.14.1, but you'll have pybel 0.13.2 which is incompatible. ERROR: compath-utils 0.3.2 has requirement sqlalchemy==1.3.8, but you'll have sqlalchemy 1.3.15 which is incompatible. ERROR: bel-repository 0.1.0 has requirement pybel<0.15.0,>=0.14.2, but you'll have pybel 0.13.2 which is incompatible.
The package builds though, and it is able to do python3 -m pathme wikipathways download just fine. However then when I go to python3 -m pathme wikipathways bel, I run into some cryptic errors:
File "~/utils/miniconda3/envs/pathways2/lib/python3.8/runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "~/utils/miniconda3/envs/pathways2/lib/python3.8/runpy.py", line 86, in _run_code exec(code, run_globals) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/pathme/__main__.py", line 8, in <module> main() File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/pathme/wikipathways/cli.py", line 72, in bel resource_files = iterate_wikipathways_paths(resource_folder, connection, only_canonical) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/pathme/wikipathways/utils.py", line 379, in iterate_wikipathways_paths wikipathways_manager = WikiPathwaysManager(connection) File "~/utils/miniconda3/envs/pathways2/lib/python3.8/site-packages/compath_utils/manager.py", line 46, in __init__ raise TypeError(f'{self.pathway_model} should inherit from {CompathPathwayMixin}') TypeError: <class 'bio2bel_wikipathways.models.Pathway'> should inherit from <class 'compath_utils.models.CompathPathwayMixin'>
Any thoughts?
Thanks!
MT
We’re right in the middle of a major upgrade of the entire compath and bio2bel ecosystem to rely on pybel 14 and PyOBO. Is there a reason using the docker image or installing from PyPI isn’t sufficient?
Though I would be happy to prioritize fixing this all up so you can get the bleeding edge code working! Just out of curiosity, what are you going to use this for? @ddomingof @10mubeen and I will be happy to support you
Oh I installed 1.13 dev from git thinking it might solve the issue, I had the same thing happen on 1.12 from PyPi. It also seems like this happens on both python 3.7 and 3.8 for both versions. I also can't use docker on my cluster due to security, but can use singularity if there's a singularity container?
I've got a whole bunch of single cell RNAseq and I was going to try to do some quick tinkering with predicting signaling pathway receptivity before I test in vivo. What I need to get to is the networkx graph of bel relationships!
M
Hi @mtvector can you provide me with your package list installed in pip?
The problem is coming from the dependencies:
Can you please ensure you have these versions of the following packages installed:
bio2bel-wikipathways 0.2.3
bio2bel 0.2.1
compath-utils 0.2.1
That should fix the problem
The bio2bel packages look okay
bio2bel 0.2.1
bio2bel-chebi 0.2.1
bio2bel-hgnc 0.2.2
bio2bel-kegg 0.2.5
bio2bel-reactome 0.2.3
bio2bel-wikipathways 0.2.3
But it looks like pip installed a different compath?
compath-utils 0.3.2
Ok, that should be the problem install
compath-utils 0.2.1
python -m pip install "compath_utils==0.2.1"
should fix it
hmmm actually now that I have compath_utils 0.2.1, I get ModuleNotFoundError: No module named 'compath_utils'
when running python3 -m pathme wikipathways bel
Okay actually after pip uninstall compath_utils
and then python -m pip install "compath_utils==0.2.1"
it works! Thanks for the help, I imagine this is getting streamlined with the current work you're doing
Oops well it loads the database now, and then I get :
Exporting WikiPathways to BEL in /wynton/home/ye/mschmitz1/.pathme/wikipathways/bel: 0%| | 0/509 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/__main__.py", line 8, in <module>
main()
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/cli.py", line 75, in bel
wikipathways_to_pickles(resource_files, resource_folder, hgnc_manager, export_folder)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/rdf_sparql.py", line 301, in wikipathways_to_pickles
bel_graph = wikipathways_to_bel(pathway_path, hgnc_manager)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/rdf_sparql.py", line 275, in wikipathways_to_bel
return rdf_wikipathways_to_bel(rdf_graph, hgnc_manager)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/rdf_sparql.py", line 264, in rdf_wikipathways_to_bel
return convert_to_bel(nodes, complexes, interactions, metadata, hgnc_manager)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/convert_to_bel.py", line 59, in convert_to_bel
nodes.update(complexes_to_bel(complexes, nodes, graph))
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/convert_to_bel.py", line 128, in complexes_to_bel
for complex_id, complex_dict in complexes.items()
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/convert_to_bel.py", line 129, in <dictcomp>
if _check_empty_complex(complex_dict, nodes)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/convert_to_bel.py", line 27, in _check_empty_complex
for member_id in complex['participants']
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pathme/wikipathways/convert_to_bel.py", line 28, in <setcomp>
if member_id in nodes
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pybel/dsl/node_classes.py", line 100, in __hash__
return hash(self.as_bel())
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pybel/dsl/node_classes.py", line 285, in as_bel
return super().as_bel(use_identifiers=use_identifiers)
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pybel/dsl/node_classes.py", line 181, in as_bel
self.obo if use_identifiers and self.entity.identifier and self.entity.name else self.curie,
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pybel/dsl/node_classes.py", line 175, in obo
return self.entity.obo
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pybel/language.py", line 77, in obo
ensure_quotes(self.identifier),
File "/wynton/home/ye/mschmitz1/utils/miniconda3/envs/pathways2/lib/python3.7/site-packages/pybel/utils.py", line 96, in ensure_quotes
return '"{}"'.format(s) if not s.isalnum() else s
AttributeError: 'int' object has no attribute 'isalnum'
Exporting WikiPathways to BEL in /wynton/home/ye/mschmitz1/.pathme/wikipathways/bel: 0%| | 0/509 [00:19<?, ?it/s]
Which version of pybel is that. It should be 0.13.2. With that error I think it is 0.14.x. I think installing pathme from the dev completely built the updated dependencies that are broken. Please check that is the problem. Otherwise cant you install pathme from PyPi cause that should work https://pypi.org/project/pathme/
Apologize for the mess
These are the requirement that should have been installed from setup.cfg
click==7.0
pandas==0.24.2
tqdm==4.31.1
numpy==1.16.3
rdflib==4.2.2
bio2bel==0.2.1
bio2bel_hgnc==0.2.2
bio2bel_chebi==0.2.1
bio2bel_kegg==0.2.5
bio2bel_wikipathways==0.2.3
bio2bel_reactome==0.2.3
pybel==0.13.2
pybel-tools>=0.7.2
pybel-cx==0.1.3
Okay so those packages had gotten all messed up when I tried installing compath_utils without uninstalling. Making a fresh conda env in python 3.8, then:
pip install pathme
pip uninstall compath-utils
python -m pip install "compath_utils==0.2.1"
python3 -m pathme wikipathways bel
appears to work! thanks for your patience!