Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install latest haystack version on Windows #446

Closed
sophgit opened this issue Sep 29, 2020 · 11 comments · Fixed by #480
Closed

Unable to install latest haystack version on Windows #446

sophgit opened this issue Sep 29, 2020 · 11 comments · Fixed by #480
Assignees
Labels
type:bug Something isn't working

Comments

@sophgit
Copy link

sophgit commented Sep 29, 2020

Describe the bug:

I can't install the latest haystack version on Windows and therefore can't use haystack properly. Tried using pip install farm-haystack==0.4.0 and pip install git+https://github.com/deepset-ai/haystack.git. I suspect it has something to do with faiss-cpu not being compatible with Windows. Is there a way to use haystack anyways? Thanks :)

Error message:

AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
----------------------------------------
ERROR: Failed building wheel for faiss-cpu
Running setup.py clean for faiss-cpu
Failed to build faiss-cpu
Installing collected packages: faiss-cpu, farm-haystack
Running setup.py install for faiss-cpu ... error
ERROR: Command errored out with exit status 1

System:

  • OS: Windows
  • Haystack version (commit or version number): 0.4.0
@sophgit sophgit added the type:bug Something isn't working label Sep 29, 2020
@lalitpagaria
Copy link
Contributor

lalitpagaria commented Sep 29, 2020

Facebook officially support Conda packages on MacOS and Linux (refer thread). So in order to use it on Windows, you have to build package by yourself (refer build instructions) or use linux docker image.

@tanaysoni
Copy link
Contributor

Hi @sophgit, FAISS is currently a required dependency for installing Haystack. In the next weeks, we plan to make it optional, so Haystack can be used on Windows(except the FAISSDocumentStore).

Meanwhile, you could try out the tutorials on Google Colab.

@Zenahr
Copy link
Contributor

Zenahr commented Oct 10, 2020

Ran into this too. Would be lovely if you could add a little note in here right next to the flag notice and probably here would also be good.

@Zenahr
Copy link
Contributor

Zenahr commented Oct 10, 2020

@lalitpagaria Is there a quick and dirty way to remove the faiss-dependency ourselves?

@Zenahr
Copy link
Contributor

Zenahr commented Oct 10, 2020

@sophgit I managed installing the pip package by using the source and modifying one line inside the requirements.txt file.

I just commented out faiss-cpu since I won't be using it for now (I hope).
Assuming the haystack source is inside a folder called ´haystack´ then this following command works (after source modification):

´ pip install haystack -f https://download.pytorch.org/whl/torch_stable.html´

@Zenahr
Copy link
Contributor

Zenahr commented Oct 10, 2020

@lalitpagaria furthermore uvloop is not supported on Windows either and probably won't be too soon

@lalitpagaria
Copy link
Contributor

@Zenahr I am afraid it is not easy to compile on Window. Faiss team posed this -

Currently Faiss compiles only on Linux and Mac.

Porting to Windows requires:

prepare a makefile or Visual project file [using gnu make on windows is also OK]
converting some system-level calls like random, gettimeofday and pthread_create to their Windows equivalents (or use a glue library that does this) [not necessary, pthread_t is used only in Ondisk, which will not be supported anyways]
the code assumes that long = int64_t at quite some places, when long is 32 bit on Windows [FIXED]
fix the SSE includes (the SSE intrinsics are Intel standard)
find a usable BLAS implementation
optional: port the GPU version and the Python interface.
find a continuous integration that works with windows
If you are interested in undertaking this, please contact us!

I think if you are not using FaissDocumentStore then as @tanaysoni mentioned, making faiss optional or removing from requirement.txt will help. If you do need it then integrating Mivus with haystack would solve this.

@Zenahr
Copy link
Contributor

Zenahr commented Oct 11, 2020

@lalitpagaria Yeah that's basically what I wanted to say. Maybe we could have a branch windows where these things are accounted for and i.e. some dependencies commented out from the requirements.txt file so that it's straight-forward to work with haystack on Windows machines.

@lalitpagaria
Copy link
Contributor

@Zenahr and @sophgit I raised PR. Can you please test changes on windows platform by running -

pip install git+https://github.com/lalitpagaria/haystack.git@fix_windows_installation

@lalitpagaria
Copy link
Contributor

Good news! Now Faiss (CPU) supports Windows.
https://github.com/facebookresearch/faiss/releases/tag/v1.6.4 (Official release on Conda)
https://pypi.org/project/faiss-cpu/#files (community supported release on pypi)

@tholor
Copy link
Member

tholor commented Nov 5, 2020

Nice! We should do some benchmarking to verify performance and then upgrade. Yesterday I had some issues with the PyPI installation, but this got fixed already (kyamagu/faiss-wheels#26)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants