3

I am trying to install "en_core_web_sm", the commands i ran is:

  1. pip install spacy ( which ran perfectly and got installed)
  2. python -m spacy download en_core_web_sm ( here i'm getting error "AttributeError: module 'click.utils' has no attribute '_expand_args'" )

enter image description here

Please help to me resolve this problem.

#CODE

import nl_core_news_sm

Load pre-trained Dutch language model

nlp = nl_core_news_sm.load()

File Extension. set as 'pdf' or as 'doc(x)'

extension = 'pdf'

def create_tokenized_texts_list(extension): '''Create two lists, one with the names of the candidate and one with the tokenized resume texts extracted from either a .pdf or .doc''' resume_texts, resume_names = [], []

# Loop over the contents of the directory containing the resumes, filtering by .pdf or .doc(x)
for resume in list(filter(lambda x: extension in x, os.listdir(PROJECT_DIR + '/CV'))):
    if extension == 'pdf':
        # Read in every resume with pdf extension in the directory
        resume_texts.append(nlp(extract_text_from_pdf(PROJECT_DIR + '/CV/' + resume)))
    elif 'doc' in extension:
        # Read in every resume with .doc or .docx extension in the directory
        resume_texts.append(nlp(extract_text_from_word(PROJECT_DIR + '/CV/' + resume)))
        
    resume_names.append(resume.split('_')[0].capitalize())

here it the code that i'm trying to run

shubham k.
  • 41
  • 2

4 Answers4

6

You will need a click version of minimum 8.0.0 to resolve this. Use the command below to upgrade to latest version

pip install --upgrade click

Aparna
  • 81
  • 5
1

I had the same issue, and solved it this way: First, I updated Conda, running this command on Conda's own Powershell conda update -n base -c defaults conda Then in the same PowerShell, running these 2 commands from Spacy's documentation: conda install -c conda-forge spacy python -m spacy download en_core_web_sm Source: https://spacy.io/usage

M_Idk392845
  • 123
  • 3
  • 12
0

Upgrade to click v8, e.g. with pip install 'click~=8.0'.

aab
  • 10,858
  • 22
  • 38
  • I had the same error as the author, running the line you kindly posted on my CMD gave me: ERROR: Could not find a version that satisfies the requirement 8.0 (from versions: none). I also tried pip install click 8.1.3 and had the same reply. The command pip install click reports the following: "Requirement already satisfied"... Thanks :) – M_Idk392845 Feb 02 '23 at 22:34
  • What version do you get with `pip install -U click`? I think you would need python 3.7+ for this version of `click`, so if you have python 3.6, I think you'd need to try earlier versions of `typer` instead of newer versions of `click`. (The original author has python 3.8 and I think this answer should be the easiest workaround for that case.) – aab Feb 03 '23 at 08:29
  • Thank you! Actually, what I did was to update conda from Conda's own powershell using the command $ conda update -n base -c defaults conda. Then, I ran these 2 commands to install Spacy and the lib: conda install -c conda-forge spacy python -m spacy download en_core_web_sm It did work. Thanks everybody! – M_Idk392845 Feb 03 '23 at 13:41
0

You have to upgrade the library click by running pip install -U click

If you are using Jupyter, reset the kernel after upgrading click.