Skip to content

exercises/en/solution_01_02_01.py: adding try except ImportError - #140

Open
davidam wants to merge 1 commit into
explosion:masterfrom
davidam:master
Open

davidam wants to merge 1 commit into
explosion:masterfrom
davidam:master

Conversation

@davidam

@davidam davidam commented Oct 3, 2026

Copy link
Copy Markdown

The exercises have spacy package as dependency. So, we could make a python package with the course or adding in the python files:

import os

try:
    import spacy
except ImportError:
    os.system("python3 -m pip install --upgrade pip")
    print("installing spacy...")
    os.system("pip install spacy")
    print("installed spacy.")
    import spacy

try:
    import en_core_web_sm
except ImportError:
    os.system("python -m spacy download en")

Thanks for your job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant