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

Issue with installing faiss-cpu #1104

Closed
MaheshChandrra opened this issue Feb 13, 2020 · 4 comments
Closed

Issue with installing faiss-cpu #1104

MaheshChandrra opened this issue Feb 13, 2020 · 4 comments
Labels

Comments

@MaheshChandrra
Copy link

MaheshChandrra commented Feb 13, 2020

Hi

I'm facing an issue while installing faiss on windows machine,tried installing using both pip and conda as well.

OS:Windows
Python Version :3.7

pip install faiss-cpu
conda install faiss-cpu -c pytorch

Please find the error log:

(base) C:\Users\MaheshChandra>pip install faiss-cpu
Collecting faiss-cpu
  Using cached https://files.pythonhosted.org/packages/7f/6b/50cdd89d6057e1dbda0
5b1f9daccea318a6d6fce07c3f9dda63b1dd9c34c/faiss-cpu-1.6.1.tar.gz
Requirement already satisfied: numpy in c:\users\MaheshChandra\appdata\local\continuu
m\anaconda3\lib\site-packages (from faiss-cpu) (1.17.4)
Building wheels for collected packages: faiss-cpu
  Building wheel for faiss-cpu (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\python.exe' -u
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\MaheshChandra\\Ap
pData\\Local\\Temp\\pip-install-hs5t1m_g\\faiss-cpu\\setup.py'"'"'; __file__='"'
"'C:\\Users\\MaheshChandra\\AppData\\Local\\Temp\\pip-install-hs5t1m_g\\faiss-cpu\\se
tup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().re
place('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'
exec'"'"'))' bdist_wheel -d 'C:\Users\MaheshChandra\AppData\Local\Temp\pip-wheel-gdd2
153g' --python-tag cp37
       cwd: C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\

  Complete output (36 lines):
  running bdist_wheel
  running build
  running build_ext
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\se
tup.py", line 107, in <module>
      ext_modules=[_swigfaiss]
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\site-packages\
setuptools\__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\core
.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\dist
.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\dist
.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\site-packages\
wheel\bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\cmd.
py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\dist
.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\comm
and\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\cmd.
py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\dist
.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\se
tup.py", line 45, in run
      build_ext.run(self)
    File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\comm
and\build_ext.py", line 340, in run
      self.build_extensions()
    File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\se
tup.py", line 50, in build_extensions
      self._remove_flag('-Wstrict-prototypes')
    File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\se
tup.py", line 58, in _remove_flag
      compiler = self.compiler.compiler
  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
    Running setup.py install for faiss-cpu ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\python.exe' -
u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\MaheshChandra\\
AppData\\Local\\Temp\\pip-install-hs5t1m_g\\faiss-cpu\\setup.py'"'"'; __file__='
"'"'C:\\Users\\MaheshChandra\\AppData\\Local\\Temp\\pip-install-hs5t1m_g\\faiss-cpu\\
setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().
replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'
"'exec'"'"'))' install --record 'C:\Users\MaheshChandra\AppData\Local\Temp\pip-record
-i5imt9uc\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cp
u\
    Complete output (38 lines):
    running install
    running build
    running build_ext
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\
setup.py", line 107, in <module>
        ext_modules=[_swigfaiss]
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\site-package
s\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\co
re.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\di
st.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\di
st.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\site-package
s\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\co
mmand\install.py", line 545, in run
        self.run_command('build')
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\cm
d.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\di
st.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\co
mmand\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\cm
d.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\di
st.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\
setup.py", line 45, in run
        build_ext.run(self)
      File "C:\Users\MaheshChandra\AppData\Local\Continuum\anaconda3\lib\distutils\co
mmand\build_ext.py", line 340, in run
        self.build_extensions()
      File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\
setup.py", line 50, in build_extensions
        self._remove_flag('-Wstrict-prototypes')
      File "C:\Users\MaheshChandra\AppData\Local\Temp\pip-install-hs5t1m_g\faiss-cpu\
setup.py", line 58, in _remove_flag
        compiler = self.compiler.compiler
    AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\MaheshChandra\AppData\Local\
Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.arg
v[0] = '"'"'C:\\Users\\MaheshChandra\\AppData\\Local\\Temp\\pip-install-hs5t1m_g\\fai
ss-cpu\\setup.py'"'"'; __file__='"'"'C:\\Users\\MaheshChandra\\AppData\\Local\\Temp\\
pip-install-hs5t1m_g\\faiss-cpu\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"
', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close()
;exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\mchan
dra\AppData\Local\Temp\pip-record-i5imt9uc\install-record.txt' --single-version-
externally-managed --compile Check the logs for full command output.

AttributeError: 'MSVCCompiler' object has no attribute 'compiler'

From the above line,I feel there's an issue with Microsoft Visual Code Compiler,can you please let me know what version would allow me to install cpu version of faiss

Thanks in advance.

@mdouze
Copy link
Contributor

mdouze commented Feb 20, 2020

Faiss is not supported on windows. If you want to work on porting Faiss to Windows, please look at this project: https://github.com/facebookresearch/faiss/projects/2

@mdouze mdouze added the install label Feb 20, 2020
@mdouze
Copy link
Contributor

mdouze commented Feb 28, 2020

No activity, closing.

@mdouze mdouze closed this as completed Feb 28, 2020
@jamesjun
Copy link

Greetings. Our team (FRL-Agios) is developing a signal processing pipeline for Oculus and we recently learned that FAISS is not supported in Windows. Given that Oculus is natively supported in Windows, it would be highly beneficial for us to have FAISS ported to Windows. Is there any new development in this?

@beauby
Copy link
Contributor

beauby commented Aug 24, 2020

@jamesjun It's underway, and will be part of the next release. You can follow progress here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants