0

I'm getting the error

`Error in py_call_impl(callable, dots$args, dots$keywords) : error: bad escape \p at position 257 `

running a python code with R through the use of "reticulate" package.

The issue comes up while executing the row:

spacy.load('en_core_web_lg')

I already checked with spacy validate that I have a version of spacy (v2.0.18) that agrees with the language model version (2.0.0).

Of course the code runs fine if executed with python.

utilizzatore
  • 33
  • 1
  • 3
  • So, `python -m spacy validate` (as suggested [here](https://github.com/explosion/spaCy/issues/3544)) does not help, right? – Wiktor Stribiżew Jan 24 '20 at 16:02
  • @WiktorStribiżew yes, it doesn't help as I said – utilizzatore Jan 24 '20 at 16:07
  • Is `en_core_web_lg` definitely installed in the same python environment that you are using to run `reticulate`? I normally set up a specific environment in conda and then use the `reticulate::use_condaenv()` function to make sure the correct packages are available. – meenaparam Jan 24 '20 at 17:33
  • @meenaparam Yes, it is in the same environment – utilizzatore Jan 27 '20 at 08:40
  • @meenaparam if I write `repl_python()` and then `import spacy` it runs. If I try to load the language model with `spacy.load('en_core_web_lg')` it returns the error. – utilizzatore Jan 27 '20 at 11:15
  • So the error doesn't happen in the REPL, only outside of the REPL? – meenaparam Jan 29 '20 at 14:46

1 Answers1

1

You should install the latest version of language model through the following command

!pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz

This should solve the error

Arjun Sikhwal
  • 11
  • 1
  • 3