1

I want to install fasttext using pip. But fasttext needs Cython. The error can be seen here:

Complete output from command python setup.py egg_info:    
Traceback (most recent call last):      
  File "<string>", line 1, in <module>      
  File "/tmp/pip-install-3if14395/fasttext/setup.py", line 3, in <module>        
    from Cython.Build import cythonize    
ModuleNotFoundError: No module named 'Cython'

To solve this from the command line, I would do:

pip install Cython
pip install fasttext

and it would work.

But here, I need to install my packages from a single requirements.txt file like this: pip install -r requirements.txt.

If my requirements.txt file looks like this:

Cython
fasttext

It still gives me the error that fasttext needs Cython to be installed.

Is there a way, all in a single requirements.txt file, to ask pip to wait until Cython is installed to launch the fasttext install?

4

1 回答 1

1

如果要安装,请fasttext尝试将以下内容添加到您的 requirements.txt:

numpy
scipy
pybind11
git+https://github.com/facebookresearch/fastText.git
于 2018-08-17T15:48:06.483 回答