Skip to content

[Bug]: flair is not a package #3685

@luigibrancati

Description

@luigibrancati

Describe the bug

When trying to use flair on a clean environment, I get the ModuleNotFoundError: No module named 'flair.data'; 'flair' is not a package error. I tried with several python versions, from 3.10 to 3.12, installed with both conda and uv, but always get the error.

To Reproduce

python
Python 3.11.0 (main, Mar  1 2023, 18:26:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from flair.nn import Classifier
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/c/Users/BrancatiLuigi/Documents/Hype/test_presidio/flair.py", line 4, in <module>
    from presidio_analyzer import (
ModuleNotFoundError: No module named 'presidio_analyzer'

Expected behavior

❯ python
Python 3.11.0 (main, Mar  1 2023, 18:26:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from flair.nn import Classifier
>>>

Logs and Stack traces


Screenshots

No response

Additional Context

No response

Environment

I can't find collect_env.py, so I'll just past pip freeze output

accelerate==1.10.1
annotated-types==0.7.0
attrs==25.3.0
beautifulsoup4==4.13.5
bioc==2.1
blis==1.3.0
boto3==1.40.38
botocore==1.40.38
catalogue==2.0.10
certifi==2025.8.3
charset-normalizer==3.4.3
click==8.3.0
cloudpathlib==0.22.0
confection==0.1.5
conllu==4.5.3
contourpy==1.3.3
cycler==0.12.1
cymem==2.0.11
Deprecated==1.2.18
docopt==0.6.2
filelock==3.19.1
flair==0.15.1
fonttools==4.60.0
fsspec==2025.9.0
ftfy==6.3.1
gdown==5.2.0
hf-xet==1.1.10
huggingface-hub==0.35.1
idna==3.10
intervaltree==3.1.0
Jinja2==3.1.6
jmespath==1.0.1
joblib==1.5.2
jsonlines==4.0.0
kiwisolver==1.4.9
langcodes==3.5.0
langdetect==1.0.9
language_data==1.3.0
lxml==6.0.2
marisa-trie==1.3.1
markdown-it-py==4.0.0
MarkupSafe==3.0.2
matplotlib==3.10.6
mdurl==0.1.2
more-itertools==10.8.0
mpld3==0.5.11
mpmath==1.3.0
murmurhash==1.0.13
networkx==3.5
numpy==2.3.3
nvidia-cublas-cu12==12.8.4.1
nvidia-cuda-cupti-cu12==12.8.90
nvidia-cuda-nvrtc-cu12==12.8.93
nvidia-cuda-runtime-cu12==12.8.90
nvidia-cudnn-cu12==9.10.2.21
nvidia-cufft-cu12==11.3.3.83
nvidia-cufile-cu12==1.13.1.3
nvidia-curand-cu12==10.3.9.90
nvidia-cusolver-cu12==11.7.3.90
nvidia-cusparse-cu12==12.5.8.93
nvidia-cusparselt-cu12==0.7.1
nvidia-nccl-cu12==2.27.3
nvidia-nvjitlink-cu12==12.8.93
nvidia-nvtx-cu12==12.8.90
packaging==25.0
phonenumbers==9.0.14
pillow==11.3.0
pptree==3.1
preshed==3.0.10
presidio_analyzer==2.2.360
protobuf==6.32.1
psutil==7.1.0
pydantic==2.11.9
pydantic_core==2.33.2
Pygments==2.19.2
pyparsing==3.2.5
PySocks==1.7.1
python-dateutil==2.9.0.post0
pytorch_revgrad==0.2.0
PyYAML==6.0.2
regex==2025.9.18
requests==2.32.5
requests-file==2.1.0
rich==14.1.0
s3transfer==0.14.0
safetensors==0.6.2
scikit-learn==1.7.2
scipy==1.16.2
segtok==1.5.11
sentencepiece==0.2.1
shellingham==1.5.4
six==1.17.0
smart_open==7.3.1
sortedcontainers==2.4.0
soupsieve==2.8
spacy==3.8.7
spacy-legacy==3.0.12
spacy-loggers==1.0.5
sqlitedict==2.1.0
srsly==2.5.1
sympy==1.14.0
tabulate==0.9.0
thinc==8.3.6
threadpoolctl==3.6.0
tldextract==5.3.0
tokenizers==0.22.1
torch==2.8.0
tqdm==4.67.1
transformer-smaller-training-vocab==0.4.2
transformers==4.56.2
triton==3.4.0
typer==0.19.2
typing-inspection==0.4.1
typing_extensions==4.15.0
urllib3==2.5.0
wasabi==1.1.3
wcwidth==0.2.14
weasel==0.4.1
Wikipedia-API==0.8.1
wrapt==1.17.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions