shubham k.
shubham k.

Reputation: 41

AttributeError: module 'click.utils' has no attribute '_expand_args', when i'm tring to install en_core_web_sm

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

Upvotes: 3

Views: 4123

Answers (5)

linuso77
linuso77

Reputation: 1

upgrading click version worked for me use this command.

pip install --upgrade click

Upvotes: 0

Aparna
Aparna

Reputation: 79

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

Upvotes: 6

Katupyry Mitã
Katupyry Mitã

Reputation: 21

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

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

Upvotes: 0

M_Idk392845
M_Idk392845

Reputation: 123

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

Upvotes: 1

aab
aab

Reputation: 11474

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

Upvotes: 0

Related Questions