spacyr icon indicating copy to clipboard operation
spacyr copied to clipboard

Install options for non conda environments

Open aterhorst opened this issue 3 years ago • 2 comments

I prefer Pycharm and Spyder to Conda. Using this command on my Mac:

spacy_install_virtualenv(python_path = "/Users/XXX/PycharmProjects/ner/venv/bin/python3.10",
                         python_version = "3.10",
                         lang_models = c("en_core_web_sm"))

results In this error message:

Error: Prerequisites for installing spaCy not available.

Execute the following at a terminal to install the prerequisites:
$ sudo /usr/bin/easy_install pip
$ sudo /usr/local/bin/pip install --upgrade virtualenv

I have pip working in my Pycharm virtual environment. I guess spacy_install_virtualenv() is not recognising the path?

aterhorst avatar Sep 21 '22 02:09 aterhorst

Although it's not our recommended solution, you can try installing it without spacyr.

  1. Activate virtualenv
  2. pip install spacy
  3. python -m spacy download en_core_web_sm

Let us know the results!

amatsuo avatar Sep 21 '22 08:09 amatsuo

I already had SpaCy installed. I addressed the problem by setting my environment variable this way:

Sys.setenv(PATH = paste("/Users/XXX/PycharmProjects/ner/venv/bin", Sys.getenv("PATH"), sep = .Platform$path.sep),
           VIRTUAL_ENV = "/Users/XXX/PycharmProjects/ner/venv/")

spacy_initialize(model = "en_core_web_sm")

Everything works now

aterhorst avatar Sep 23 '22 05:09 aterhorst

Hello! I also had SpaCy installed in: "/Users/xxx/opt/anaconda3/lib/python3.8/site-packages" What I should do to initialize spacy? I tried to revise your codes but was confused about what paths I should write within paste() and behineVIRTUAL_ENV=

I'm still new to Python and R. I've tried the spacy_install() and spacy_initialize(model = "en_core_web_sm") for hours, but I keep receiving mistakes...

Thank you!

bearT2 avatar Feb 10 '23 18:02 bearT2

Solved in v1.3.

kbenoit avatar Dec 13 '23 11:12 kbenoit