2017-02-09 1 views
3

Ancien grognement marin ici! Nouveau sur python et codage. Essayer d'installer DLIB pour python 2.7. Je lance la commande pip install dlib et continue de recevoir ce message d'erreur:Dlib installation python 2.7

Collecting dlib 
    Using cached dlib-19.1.0.tar.gz 
Building wheels for collected packages: dlib 
    Running setup.py bdist_wheel for dlib ... error 
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\pickfl~1\\appdata\\local\\temp\\pip-build-4qhao2\\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\pickfl~1\appdata\local\temp\tmpcvgy9jpip-wheel- --python-tag cp27: 
    running bdist_wheel 
    running build 
    Detected Python architecture: 32bit 
    Detected platform: win32 
    Configuring cmake ... 
    -- 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/Pickflickr1/AppData/Local/Temp/pip-build-4qhao2/dlib/tools/python/build/CMakeFiles/CMakeOutput.log". 
    See also "C:/Users/Pickflickr1/AppData/Local/Temp/pip-build-4qhao2/dlib/tools/python/build/CMakeFiles/CMakeError.log". 
    error: cmake configuration failed! 

    ---------------------------------------- Failed building wheel for dlib 

Along with this: 
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\pickfl~1\\appdata\\local\\temp\\pip-build-4qhao2\\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\pickfl~1\appdata\local\temp\pip-l8pcsq-record\install-record.txt 
--single-version-externally-managed --compile" failed with error code 1 in c:\users\pickfl~1\appdata\local\temp\pip-build-4qhao2\dlib\ 

Tous les commentaires ou de l'aide serait génial! Ancien jarhead alors ours avec moi, merci.

+1

Visual Studio est-il installé sur votre ordinateur? –

+0

Avez-vous trouvé une solution? – Rizwan

Répondre

2

Essayez ceci:

conda install -c menpo dlib=18.18 
+0

nice! Mais pas besoin de spécifier la version, conda installer -c menpo dlib – Reeves

2

D'abord, vous devez avoir installé pip. Ensuite, vous pouvez télécharger la version dlib python 2.7 du site web "https://pypi.python.org/pypi/dlib/18.17.100" où vous obtiendrez la roue de dlib. Et puis utilisez la procédure normale comme pip install 'path to dlib wheel'.

Par ex. Si vous avez enregistré le fichier .whl dans le dossier des téléchargements, tapez pip install C: \ Utilisateurs \ XYZ \ Downloads \ dlib-18.17.100-cp27-none-win32.whl.

Cela fonctionnera sûrement. Quand j'ai essayé, je n'ai eu aucune erreur et dlib a été installé avec succès.

Vive

+0

Merci, cela a fonctionné pour moi! J'utilise Python 2.7 sur Windows 7 32bit. – viswanath608

0

Le paquet de pépin pourrait être cassé ou peut ne pas être mis à jour. Quoi qu'il en soit, téléchargez le dlib_master à partir de: https://github.com/davisking/dlib.git

Ensuite, il y a un guide facile pour l'installation en python. Accédez au dossier contenant setup.py, puis ouvrez le terminal et tapez sudo python setup.py install.