monarch-initiative / oncoexporter

Cancer data to GA4GH phenopacket
https://monarch-initiative.github.io/oncoexporter
MIT License
6 stars 1 forks source link

Run time error #84

Closed msierk closed 3 months ago

msierk commented 3 months ago

I've had trouble getting CDA and Oncoexporter to work on my new MacBook. I had to set up a new Conda env because my old mb was intel and the new one is M2. I kept having trouble either getting cdapython installed, oncoexporter installed, or getting the run_lung.py script to run properly. So I went to biowulf to try there (Rocky Linux). I created a new env with python 3.10, and installed phenopackets, cdapython, and oncoexporter. However I still get the following error when I try to import Q from cdapython. I assume this is a problem with cda, though maybe just an incompatibility between cda and oncoexporter and/or phenopackets? Any suggestions to fix/work around this @ielis ?

(phenopackets) python scripts/run_lung.py Traceback (most recent call last): File "/vf/users/nextgen/sierk/Phenopackets/oncoexporter/scripts/run_lung.py", line 4, in <module> from cdapython import Q File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/cdapython/__init__.py", line 35, in <module> from cdapython.factories.count import Count File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/cdapython/factories/count.py", line 11, in <module> from cdapython.results.count_result import CountResult File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/cdapython/results/count_result.py", line 3, in <module> from IPython import get_ipython File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/IPython/__init__.py", line 55, in <module> from .terminal.embed import embed File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/IPython/terminal/embed.py", line 16, in <module> from IPython.terminal.interactiveshell import TerminalInteractiveShell File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 48, in <module> from .debugger import TerminalPdb, Pdb File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/IPython/terminal/debugger.py", line 6, in <module> from IPython.core.completer import IPCompleter File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/IPython/core/completer.py", line 219, in <module> from IPython.core.guarded_eval import guarded_eval, EvaluationContext File "/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/IPython/core/guarded_eval.py", line 40, in <module> from typing_extensions import TypeAliasType ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (/vf/users/nextgen/sierk/conda/envs/phenopackets/lib/python3.10/site-packages/typing_extensions.py)

ielis commented 3 months ago

Hi, it's not obvious based on the stack trace why should you get an error like this.

How exactly did you install the library? Did you run something like the following?

cd oncoexporter
python3 -m pip install .

Or did you do manual installation of the packages, e.g. python3 -m pip install cdapython tqdm phenopackets etc.? The first is preferred.

Another reason for failure may be Conda. I do not routinely use it so I do not really know how a pip installation would behave. Can you try to use venv to create a virtual environment instead of Conda?

justaddcoffee commented 3 months ago

+1 for trying venv

I haven't tried conda in this project, but venv works okay for me on my m1 mac

ielis commented 3 months ago

Curiously, I saw the same issue in the CI result during update of #81 . It seems like the issue is present when ipython>8.22.2 is used. The CI installed a more recent version which, from some reason, did not work on Python 3.10.

One way to circumvent this is, therefore, to clip ipython to <=8.22.2, which is what I did in #81. The CI then finished OK.

@msierk, I suspect your build will work now as long as you install from the latest develop.

msierk commented 3 months ago

Curiously, I saw the same issue in the CI result during update of #81 . It seems like the issue is present when ipython>8.22.2 is used. The CI installed a more recent version which, from some reason, did not work on Python 3.10.

One way to circumvent this is, therefore, to clip ipython to <=8.22.2, which is what I did in #81. The CI then finished OK.

@msierk, I suspect your build will work now as long as you install from the latest develop.

That worked, thank you.