I am learning how to use streamlit and spaCy. How do I write the equivalent of
python -m spacy download en_core_web_lg
in requirements.yml?
The documentation said to include a requirements.yml or requirements.txt so I tried creating those files by exporting the environment. I ended up taking hours trying out different variations of pip and conda commands before I realised I should write a simplified version manually.
While I was able to figure this out eventually, I cannot figure out how to resolve the installation of language model in a yaml file. There is no documentation I can google to describe how to install a language model. Would appreciate some help on what commands to use and where exactly to put it.
Turns out it was a problem with environment.yml. I had no problem when I eventually tried using requirements.txt.
I kept getting âError during processing dependencies!â when I use yml. Morever, the whole âbakingâ process takes extremely long so the trial and error process took a few hours. I was hoping to get at least some message telling me what went wrong but the only meaningful message I got was something about âbash: line 3: 15 Killed /home/appuser/.conda/bin/conda env update -n base --file environment.ymlâ and âinstaller returned a non-zero exit codeâ. I formatted my yml according to https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually so I couldnât figure out how or why it is causing errors.
Thanks for the feedback about the lack of informative error messages when installing dependencies via environment.yml. Iâll pass it along internally.
The error with your environment.yml had to do with including the spacy model url as a dependency. The spacy docs indicate the url must be included in requirements.txt instead. Thereâs no mention of a requirements.yml in their docs.
Thanks for clarifying. I was looking at Streamlitâs documentation and didnt know spaCyâs documentation takes precedence. Just stating this here explicitly to help someone else who might run into the same problem.
Also, my initial requirements.yml actually had the following without the spacy model url. It failed even with this:
spaCyâs docs take precedence when it comes to model installation instructions. Your initial file failed because it was called requirements.txt but the contents were whatâs supposed to be in environment.yml.
After you renamed the file and included only the above, without the spacy model url, it still failed. I tried deploying an app with the exact contents youâve shared. It took ages for the âbakingâ process to complete. Once it was done, I got the identical, non-descriptive error message you did
Definitely not an ideal developer experience. I will share your feedback with the team. Thanks for your patience and taking time to explain the issue to us
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking âAccept allâ, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.