Flair: pip install flair fails

Created on 22 Jun 2019  路  4Comments  路  Source: flairNLP/flair

Describe the bug
I am trying to install flair using pip install flair command, but I can't

There are some error messages:

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-neCYMF/flair/setup.py", line 7, in <module>
    long_description=open("README.md", encoding='utf-8').read(),
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-neCYMF/flair/

Anyone knows how can I fix that problem?

Thanks

bug

Most helpful comment

I had the same issue. I solved it by downgrading to python3.6. The problem seems to be with python3.7. Start with a fresh python3.6 virtual environment and then run "pip install flair".

$ conda create -n new_env python3.6
$ source activate new_env
$ pip install flair

All 4 comments

I had the same issue. I solved it by downgrading to python3.6. The problem seems to be with python3.7. Start with a fresh python3.6 virtual environment and then run "pip install flair".

$ conda create -n new_env python3.6
$ source activate new_env
$ pip install flair

I had the same issue. I solved it by downgrading to python3.6. The problem seems to be with python3.7. Start with a fresh python3.6 virtual environment and then run "pip install flair".

$ conda create -n new_env python3.6
$ source activate new_env
$ pip install flair

Thanks, Mohit-almug. Problem solved!
I was with Conda 2.7
I uninstalled Conda 2.7 and install Conda 3.7
Now I have Python 3.7.3 and "pip install flair" worked fine

After installation, what is the path to access flair. In my case even after successful installation, the flair.py script can't be located. Any suggestions?

Flair as a package can be installed via pip depending on your Python environment. For me (macOS with direct python 3.8 installation it comes under /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/flair. In the above comments it seems like this was in combination with Anaconda / Miniconda, which usually creates an environment with dependencies (packages) different to your global ones and stores them in the directory of that environment.

In this repository, there is no flair.py, but flair/__init__.py and setup.py instead.
Before you run pip, make sure you are in the same environment where you want to use Flair.

Also, maybe you want to know where your pip and python installations are with:
which pip and which python
Again, in my case (no anaconda or homebrew installations) under
pip: /Library/Frameworks/Python.framework/Versions/3.8/bin/pip
python: aliased to /usr/local/bin/python3.8

Was this page helpful?
0 / 5 - 0 ratings