Having issues installing face-recognition module for Python 2.7- 32 bit on Windows 10 - 64 bit using pip

Viewed 228

I am new to Python and I am trying to install the face-recognition for Python 2.7- 32 bit on Windows 10 64 bit. I tried using "pip install face-recognition" and this is the error I get:

ERROR: Command errored out with exit status 1:
     command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\setup.py'"'"'; __file__='"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\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\ning\appdata\local\temp\pip-record-p9wr_4\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\dlib'
         cwd: c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\
    Complete output (64 lines):
    running install
    running build
    running build_py
    package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
    running build_ext
    Building extension for Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:19:08) [MSC v.1500 32 bit (Intel)]
    Invoking CMake setup: 'cmake c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\build\lib.win32-2.7 -DPYTHON_EXECUTABLE=c:\python27\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\build\lib.win32-2.7'
    -- Building for: Visual Studio 16 2019
    -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
    -- The C compiler identification is MSVC 19.28.29335.0
    -- The CXX compiler identification is MSVC 19.28.29335.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonInterp: C:/Python27/python.exe (found version "2.7.18")
    CMake Error at C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
      Python config failure: Python is 32-bit, chosen compiler is 64-bit
    Call Stack (most recent call first):
      C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
      C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)


    -- Configuring incomplete, errors occurred!
    See also "C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/build/temp.win32-2.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\setup.py", line 262, in <module>
        'Topic :: Software Development',
      File "c:\python27\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\python27\lib\distutils\core.py", line 151, in setup
        dist.run_commands()
      File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "c:\python27\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "c:\python27\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\python27\lib\distutils\command\install.py", line 563, in run
        self.run_command('build')
      File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "c:\python27\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "c:\python27\lib\distutils\command\build.py", line 127, in run
        self.run_command(cmd_name)
      File "c:\python27\lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "c:\python27\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\setup.py", line 135, in run
        self.build_extension(ext)
      File "c:\users\ning\appdata\local\temp\pip-install-ftghyg\dlib\setup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "c:\python27\lib\subprocess.py", line 190, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\build\\lib.win32-2.7', '-DPYTHON_EXECUTABLE=c:\\python27\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\build\\lib.win32-2.7']' returned non-zero exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\setup.py'"'"'; __file__='"'"'c:\\users\\ning\\appdata\\local\\temp\\pip-install-ftghyg\\dlib\\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\ning\appdata\local\temp\pip-record-p9wr_4\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\dlib' Check the logs for full command output.

I have installed CMake and added it to the Path variables. I can run cmake from the terminal. I have also installed Visual Studio Build Tools 2019 for C++ CMake tools for Windows. I tried "pip install dlib" as well but received the same error.

CMake Error at C:/Users/Ning/AppData/Local/Temp/pip-install-ftghyg/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
      Python config failure: Python is 32-bit, chosen compiler is 64-bit

However, I do not know how to choose the compiler in "pip install". I am not able to use any other version of python due to hardware constraints. I would be immensely grateful for any assistance. Please let me know if I need to provide more information. Thank you.

0 Answers
Related