Open RobertWang2 opened 5 years ago
PS C:\Users\simha\OneDrive\Desktop> pip install face_recognition Collecting face_recognition Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl Collecting dlib>=19.7 (from face_recognition) Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\simha\appdata\local\programs\python\python37-32\lib\site-packages (from face_recognition) (0.3.0) Requirement already satisfied: Click>=6.0 in c:\users\simha\appdata\local\programs\python\python37-32\lib\site-packages (from face_recognition) (7.0) Requirement already satisfied: numpy in c:\users\simha\appdata\local\programs\python\python37-32\lib\site-packages (from face_recognition) (1.15.4) Requirement already satisfied: Pillow in c:\users\simha\appdata\local\programs\python\python37-32\lib\site-packages (from face_recognition) (5.4.0) Building wheels for collected packages: dlib Running setup.py bdist_wheel for dlib ... error Complete output from command c:\users\simha\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\simha\AppData\Local\Temp\pip-wheel-azgm2yqa --python-tag cp37: running bdist_wheel running build running build_py package init file 'dlib__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] Invoking CMake setup: 'cmake C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\build\lib.win32-3.7 -DPYTHON_EXECUTABLE=c:\users\simha\appdata\local\programs\python\python37-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\build\lib.win32-3.7' -- Building for: NMake Makefiles -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error in CMakeLists.txt: The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt: The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/simha/AppData/Local/Temp/pip-install-c33tqxpt/dlib/build/temp.win32-3.7/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/simha/AppData/Local/Temp/pip-install-c33tqxpt/dlib/build/temp.win32-3.7/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "
Failed building wheel for dlib Running setup.py clean for dlib Failed to build dlib Installing collected packages: dlib, face-recognition Running setup.py install for dlib ... error Complete output from command c:\users\simha\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\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\simha\AppData\Local\Temp\pip-record-hjrwang2\install-record.txt --single-version-externally-managed --compile: running install running build running build_py package init file 'dlib__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] Invoking CMake setup: 'cmake C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\build\lib.win32-3.7 -DPYTHON_EXECUTABLE=c:\users\simha\appdata\local\programs\python\python37-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\build\lib.win32-3.7' -- Building for: NMake Makefiles -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error in CMakeLists.txt: The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/simha/AppData/Local/Temp/pip-install-c33tqxpt/dlib/build/temp.win32-3.7/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/simha/AppData/Local/Temp/pip-install-c33tqxpt/dlib/build/temp.win32-3.7/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\simha\appdata\local\programs\python\python37-32\lib\subprocess.py", line 341, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\simha\\AppData\\Local\\Temp\\pip-install-c33tqxpt\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\simha\\AppData\\Local\\Temp\\pip-install-c33tqxpt\\dlib\\build\\lib.win32-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\simha\\appdata\\local\\programs\\python\\python37-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\simha\\AppData\\Local\\Temp\\pip-install-c33tqxpt\\dlib\\build\\lib.win32-3.7']' returned non-zero exit status 1.
----------------------------------------
Command "c:\users\simha\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\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\simha\AppData\Local\Temp\pip-record-hjrwang2\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\simha\AppData\Local\Temp\pip-install-c33tqxpt\dlib\
could anyone please help me solve this
@RobertWang2 take a look to this: https://stackoverflow.com/questions/42164910/pyinstaller-images-fail-to-extract it shows how include a not python file. Anyway i think to make it works you need to don't use face_recognition_models but load the models directly from the file system.
@simhacharan Your comment make no sense here. Anyway i solved the dlib compilation problem on windows using Anacoda to install it.
As Janluke0 suggested, we have to add the files manually, because pyinstaller doesn't include the data files. There are different ways to go about it. One way is manually. After making the spec sheet (pyi-makespec -wF my_module.py
), open it and append to the datas
line. For me it was originally empty datas=[]
and I edited it to be the following:
datas = [
('C:\\Users\\user\\Anaconda3\\envs\\myenv\\Lib\\site-packages\\face_recognition_models',
'face_recognition_models')
]
The run pyinstaller on the spec sheet: pyinstaller my_module.spec
Description
when i using pyinstaller to generate exe file, no problem, but i exe it, result as follow:
E:\Project\FaceRecognization\face_recognition_models\models\dlib_face_recognition_resnet_model_v1.dat could not be extracted! fopen: Invalid argument
Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen. IMPORTANT: If your issue is related to a specific picture, include it so others can reproduce the issue.
What I Did
I don't know how ot do, i try install dlib again, but no gain