quanteda / spacyr

R wrapper to spaCy NLP
http://spacyr.quanteda.io
250 stars 38 forks source link

spacy_download_langmodel_virtualenv() ignores given envname; overrides with `spacy_virtualenv` #238

Closed olyerickson closed 9 months ago

olyerickson commented 1 year ago

spacy_download_langmodel_virtualenv() ignores whatever envname one gives it. Simple example:

> spacy_download_langmodel_virtualenv(model="en",
+                          envname = "r-spacyr",
+                          virtualenv_root = "/software/anaconda3/envs")

installing model "en"

Error in spacy_download_langmodel_virtualenv(model = "en", envname = "r-spacyr",  : 
  The virtual environemnt /software/anaconda3/envs/spacy_virtualenv does not exist

You can see it accepted my virtualenv_root but ignored my envname...

olyerickson commented 1 year ago

Also there is a typo in the error message ("environemnt") ;)

olyerickson commented 1 year ago

I can actually see in your source code that you ignore envname ...

https://github.com/quanteda/spacyr/blob/06b4eadd421a0f94c0645dd4297c0e60eec8545d/R/spacy_langmodel_functions.R

olyerickson commented 1 year ago

Furthermore, the implementation of spacy_download_langmodel_virtualenv() appears to assume we're using miniconda rather than conda (because it is hard-coding bin/activate)

kbenoit commented 9 months ago

Should be solved with v1.3.