Got an Error import click._bashcomplete

Hello, I have a dilemma that I am unable to resolve. My app has been available online for some time, and everything has been fantastic. This program stopped working after I restarted it after putting it to sleep. I made no changes to my requirements.txt or to anything else in general. I receive the following error:

File โ€œ/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.pyโ€, line 565, in _run_script
exec(code, module.dict)
File โ€œ/app/keywordapp/hostapp.pyโ€, line 10, in
from KeywordCrawler.extract import *
File โ€œ/app/keywordapp/KeywordCrawler/extract.pyโ€, line 7, in
from keyphrase_vectorizers import KeyphraseCountVectorizer
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/keyphrase_vectorizers/init.pyโ€, line 2, in
from keyphrase_vectorizers.keyphrase_count_vectorizer import KeyphraseCountVectorizer
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/keyphrase_vectorizers/keyphrase_count_vectorizer.pyโ€, line 19, in
from keyphrase_vectorizers.keyphrase_vectorizer_mixin import _KeyphraseVectorizerMixin
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/keyphrase_vectorizers/keyphrase_vectorizer_mixin.pyโ€, line 16, in
import spacy
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/spacy/init.pyโ€, line 14, in
from .cli.info import info # noqa: F401
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/spacy/cli/init.pyโ€, line 3, in
from ._util import app, setup_cli # noqa: F401
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/spacy/cli/_util.pyโ€, line 8, in
import typer
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/typer/init.pyโ€, line 29, in
from .main import Typer as Typer
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/typer/main.pyโ€, line 11, in
from .completion import get_completion_inspect_parameters
File โ€œ/home/appuser/venv/lib/python3.9/site-packages/typer/completion.pyโ€, line 10, in
import click._bashcomplete

Iโ€™ve already tried a variety of things, reinstalled software, and used alternative versions. Simply said, it is uselessโ€ฆ My requirements.txt is attached:
streamlit-tags~=1.2.8
streamlit
altair~=4.2.0
seaborn~=0.11.2
sentence-transformers~=2.2.2
streamlit-tags~=1.2.8
pillow~=8.4.0
keybert~=0.5.1
scrapy~=2.6.1
click<7.2.0,>=7.1.1
itemadapter~=0.4.0
requests~=2.26.0
bs4~=0.0.1
beautifulsoup4~=4.10.0
spacy==3.0.9
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
pandas~=1.3.4
selenium~=4.2.0
scrapyscript~=1.1.5
yake~=0.4.8
flair~=0.11.3
nltk~=3.6.5
streamlit-authenticator~=0.2.1
keyphrase-vectorizers~=0.0.4
numpy~=1.20.3
psutil~=5.8.0
scikit-learn~=1.1.1
scipy~=1.8.1

Iโ€™m hoping someone can assist :slight_smile: THANKS

Hey @Raisarom!

Thanks for sharing your requirements.txt. Discovered that thread saying that Typer should be upgraded to at least 0.4.0 to ensure click 7 or 8 works. Presumably one of the unpinned dependencies you use have upgraded when the app rebooted and that made things break in cascade? Not sure.

Can you give a try to adding this line in the requirements.txt

typer>=0.4.0

Hope that helps!
Best,

1 Like

Thank you so much!

I should research package management a little bit further in the future :slight_smile:

Solving dependencies is the worst! With pleasure! :balloon:

1 Like