Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with spacy_install() in R Studio #156

Closed
lioramichlin opened this issue Feb 5, 2019 · 6 comments

Comments

@lioramichlin
Copy link

commented Feb 5, 2019

Have installed and uninstalled miniconda/anaconda on my computer multiple times. Currently running the latest version of anaconda.

When trying to install spacy into R using spacy_install() I repeatedly get the error "Error: Error 1 occurred installing packages into conda environment spacy_condaenv" and don't know how to fix it.

@amatsuo

This comment has been minimized.

Copy link
Collaborator

commented Feb 5, 2019

Could you provide sessionInfo() output?

@lioramichlin

This comment has been minimized.

Copy link
Author

commented Feb 5, 2019

Sure :)

R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] spacyr_1.0

loaded via a namespace (and not attached):
[1] sentimentr_2.6.1 compiler_3.5.2 qdapRegex_0.7.2 tools_3.5.2 bindrcpp_0.2.2 glue_1.3.0 yaml_2.2.0 Rcpp_1.0.0
[9] lexicon_1.1.3 textclean_0.9.3 syuzhet_1.0.4 data.table_1.12.0 rlang_0.3.1 bindr_0.1.1

@amatsuo

This comment has been minimized.

Copy link
Collaborator

commented Feb 5, 2019

Thanks.

I am not sure what exactly is the issue, but let's try the following. In a command prompt (not in R):

  1. conda remove --name spacy_condaenv --all # remove an existing environment
  2. conda create --name spacy_condaenv python=3.6 # this create a new conda environment
  3. activate spacy_condaenv # activate the virtual enviroment you have just created
  4. pip install --ignore-installed --upgrade spacy # install spacy in the envronment
  5. python -m spacy download en # install a langmodel

If you run through all of them without an error, you should be able to spacy_initialize().

@lioramichlin

This comment has been minimized.

Copy link
Author

commented Feb 5, 2019

Thank you for your help!

I got some errors at step 4:

Failed building wheel for ujson
Failed building wheel for cytoolz 
Command "C:\Users\Liora\Anaconda3\envs\spacy_condaenv\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Liora\\AppData\\Local\\Temp\\pip-install-v5qce9t8\\cytoolz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Liora\AppData\Local\Temp\pip-record-p30pkxf3\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Liora\AppData\Local\Temp\pip-install-v5qce9t8\cytoolz\
@amatsuo

This comment has been minimized.

Copy link
Collaborator

commented Feb 5, 2019

Do you have a proper version of Visual C++? For Windows systems, you have to install it before compiling things.

https://spacy.io/usage/#source-windows

This might also informative:
https://stackoverflow.com/questions/43370851/failed-building-wheel-for-spacy/44872209

@lioramichlin

This comment has been minimized.

Copy link
Author

commented Feb 6, 2019

Ah no, I somehow missed that requirement!

Thank you so much for your help! After I installed that, spacy_install() worked directly from R. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.