Open athan-dial opened 3 years ago
Thank you for the comment, and my apologies for the delay in getting back to you on this.
Because clinspacy wraps spacy, scispacy, and medspacy, we essentially have to juggle a bunch of version issues between dependencies. The only issue I did not control for in clinspacy was the Python version. By default, clinspacy uses the reticulate::install_miniconda() function to install the latest version.
Based on your output, it looks like the issue is that spacy 2.3.0 (the version used in clinspacy) only supports up to Python 3.8 and not Python 3.9 whereas reticulate::install_miniconda() appears to be installing version Python 3.9.
In the short-term, I would recommend uninstalling this version of miniconda and manually installing miniconda with Python 3.8 (available here: https://docs.conda.io/en/latest/miniconda.html). That should work.
In the medium-term, I'm going to look into how to enforce which version of miniconda is installed. It looks like although scispacy currently supports spacy 3.0, medspacy still requires spacy 2.3.
It looks like reticulate
will soon allow the miniconda URL to be specified as an option()
within R.
https://github.com/rstudio/reticulate/commit/486f0a5968436231367a7521af6040464b172ff6
As soon as this version of reticulate lands on CRAN, I'll plan to update clinspacy with a way to install the correct version of miniconda.
Actually, I discovered that the problem was with reticulate::conda_create()
, which installs the latest version of Python (right now = 3.9) into the newly created conda environment regardless of which version of miniconda is installed.
Because spacy 2.3.0 (needed for compatibility with medspacy) only supports up to Python 3.8, this creates a problem.
This is now fixed on the GitHub version of clinspacy
. By updating to a newer version of reticulate
(>= 1.19), we can now specify which Python version is needed in conda_create()
, so I've set this up to require Python 3.8.
To fix, run this:
reticulate::conda_remove('clinspacy')
remotes::install_github('ML4LHS/clinspacy')
Then, when you run clinspacy_init()
, everything should work.
Please let me know if this fixes the issue, and I'll plan to send this version to CRAN.
I know I'm a few years late, but have you found a solution to this that still works in the updated versions of everything? I still have issues because of space 2.3.0.
Hi Karandeep, I have the same problem, could you please help me?
I will try to fix in the next 1-2 weeks. I haven't touched my R package codebase in a while but I will come back to this. Thank you for the ping.
I'm not having any success initializing clinspacy. It goes through the same sequence with and without the
miniconda = FALSE
argument. I've also tried to downgrade python to 3.6 to initial tutorial. Any idea how to get around this issue with Python version? Example of code below