pip cmake Failed to build dlib package - python

I'm trying to install dlib using cmd.
I installed cmake, wheel, opencv-python, cv2 and face_recognition successfully,
but I have trouble to install dlib.
If tried pip install dlib but it's not working.
I also download dlib-19.22.0.tar.
I'm getting this error message:
Collecting dlib
Using cached dlib-19.22.0.tar.gz (7.4 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'd:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\washi\\AppData\\Local\\Temp\\pip-install-_kij9b6z\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\washi\\AppData\\Local\\Temp\\pip-install-_kij9b6z\\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\washi\AppData\Local\Temp\pip-wheel-yhq98ysd'
cwd: C:\Users\washi\AppData\Local\Temp\pip-install-_kij9b6z\dlib\
Complete output (55 lines):
running bdist_wheel
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 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\washi\AppData\Local\Temp\pip-install-_kij9b6z\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\washi\AppData\Local\Temp\pip-install-_kij9b6z\dlib\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=d:\program files\python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\washi\AppData\Local\Temp\pip-install-_kij9b6z\dlib\build\lib.win-amd64-3.9 -A x64'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version to target Windows 10.0.19041.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:14 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:14 (project):
No CMAKE_CXX_COMPILER could be found.
--Configuring incomplete, errors occurred!
----------------------------------------
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error

Related

Error with pip install pybgs - How to solve this error : error: command 'cmake' failed: No such file or directory

I want to install the BGSLibrary (https://pypi.org/project/pybgs/) but I have an error. I don't know what to do...
Here is the error :
(base) C:\Users\qh742176>pip install pybgs
Collecting pybgs
Using cached pybgs-3.0.0.post2.tar.gz (850 kB)
Building wheels for collected packages: pybgs
Building wheel for pybgs (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\qh742176\\AppData\\Local\\Temp\\pip-install-fjuvyr0k\\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\\setup.py'"'"'; __file__='"'"'C:\\Users\\qh742176\\AppData\\Local\\Temp\\pip-install-fjuvyr0k\\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\\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\qh742176\AppData\Local\Temp\pip-wheel-hlpvbn7p'
cwd: C:\Users\qh742176\AppData\Local\Temp\pip-install-fjuvyr0k\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\
Complete output (7 lines):
running bdist_wheel
running build
running build_ext
Preparing the build environment
Configuring cmake project
cmake -HC:\Users\qh742176\AppData\Local\Temp\pip-install-fjuvyr0k\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40 -Bbuild\temp.win-amd64-3.8\Release -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DBGS_CORE_STATIC=ON -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_ONLY=ON -DBGS_PYTHON_VERSION=3.8
error: command 'cmake' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for pybgs
Running setup.py clean for pybgs
Failed to build pybgs
Installing collected packages: pybgs
Running setup.py install for pybgs ... error
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\qh742176\\AppData\\Local\\Temp\\pip-install-fjuvyr0k\\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\\setup.py'"'"'; __file__='"'"'C:\\Users\\qh742176\\AppData\\Local\\Temp\\pip-install-fjuvyr0k\\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\\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\qh742176\AppData\Local\Temp\pip-record-fxqcfc47\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\pybgs'
cwd: C:\Users\qh742176\AppData\Local\Temp\pip-install-fjuvyr0k\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\
Complete output (7 lines):
running install
running build
running build_ext
Preparing the build environment
Configuring cmake project
cmake -HC:\Users\qh742176\AppData\Local\Temp\pip-install-fjuvyr0k\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40 -Bbuild\temp.win-amd64-3.8\Release -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DBGS_CORE_STATIC=ON -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_ONLY=ON -DBGS_PYTHON_VERSION=3.8
error: command 'cmake' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\qh742176\\AppData\\Local\\Temp\\pip-install-fjuvyr0k\\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\\setup.py'"'"'; __file__='"'"'C:\\Users\\qh742176\\AppData\\Local\\Temp\\pip-install-fjuvyr0k\\pybgs_ac5042fa9d0c4e1faf1ee0536d1a5f40\\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\qh742176\AppData\Local\Temp\pip-record-fxqcfc47\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\pybgs' Check the logs for full command output.
I have python with Anaconda.
Python 3.8.8
UPDATE :
I didn't download OpenCV neither Visual Studio.
Now I have Visual Studio Community 2019 and OpenCV 4.5.2.
But now during the Building binaries I have this error : MSBUILD : error MSB001 : Unknow switch.
Here is the error :
(base) C:\Users\quent>pip install pybgs
Collecting pybgs
Using cached pybgs-3.0.0.post2.tar.gz (850 kB)
Building wheels for collected packages: pybgs
Building wheel for pybgs (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\quent\\AppData\\Local\\Temp\\pip-install-ii8ti1lp\\pybgs_4f048535b22c4fd299172823d5938fb6\\setup.py'"'"'; __file__='"'"'C:\\Users\\quent\\AppData\\Local\\Temp\\pip-install-ii8ti1lp\\pybgs_4f048535b22c4fd299172823d5938fb6\\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\quent\AppData\Local\Temp\pip-wheel-ao02fvnp'
cwd: C:\Users\quent\AppData\Local\Temp\pip-install-ii8ti1lp\pybgs_4f048535b22c4fd299172823d5938fb6\
Complete output (61 lines):
running bdist_wheel
running build
running build_ext
Preparing the build environment
Configuring cmake project
C:\Program Files\CMake\bin\cmake.exe -HC:\Users\quent\AppData\Local\Temp\pip-install-ii8ti1lp\pybgs_4f048535b22c4fd299172823d5938fb6 -Bbuild\temp.win-amd64-3.8\Release -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DBGS_CORE_STATIC=ON -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_ONLY=ON -DBGS_PYTHON_VERSION=3.8
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.28.29915.0
-- The CXX compiler identification is MSVC 19.28.29915.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/Community/VC/Tools/MSVC/14.28.29910/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/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- BGS_PYTHON_SUPPORT: ON
-- BGS_PYTHON_ONLY: ON
-- BGS_CORE_STATIC: ON
-- PYTHON VERSION: 3.8
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: vc15
-- OpenCV STATIC: OFF
-- Found OpenCV: C:/Users/quent/Downloads/opencv/build (found version "4.5.2")
-- Found OpenCV 4.5.2 in C:/Users/quent/Downloads/opencv/build/x64/vc15/lib
-- You might need to add C:\Users\quent\Downloads\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
--
-- OpenCV library status:
-- version: 4.5.2
-- libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_world
-- include path: C:/Users/quent/Downloads/opencv/build/include
-- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found suitable version "3.8.8", minimum required is "3.8")
-- Found PythonLibs: C:/ProgramData/Anaconda3/libs/Python38.lib
-- pybind11 v2.3.dev1
--
-- Python library status:
-- executable: C:/ProgramData/Anaconda3/python.exe
-- library:
-- include path: C:/ProgramData/Anaconda3/include
-- NUMPY_INCLUDE_DIR: C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include
-- Bulding bgslibrary_core STATIC
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/quent/AppData/Local/Temp/pip-install-ii8ti1lp/pybgs_4f048535b22c4fd299172823d5938fb6/build/temp.win-amd64-3.8/Release
Building binaries
C:\Program Files\CMake\bin\cmake.exe --build build\temp.win-amd64-3.8\Release --config Release -- -j8
Microsoft (R) Build Engine version 16.9.0+5e4b48a27 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits r‚serv‚s.
MSBUILD : error MSB1001: Commutateur inconnu.
Commutateurÿ:ÿ-j8
Pour la syntaxe du commutateur, tapez "MSBuild -help"
error: command 'C:\\Program Files\\CMake\\bin\\cmake.exe' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pybgs
Running setup.py clean for pybgs
Failed to build pybgs
Installing collected packages: pybgs
Running setup.py install for pybgs ... error
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\quent\\AppData\\Local\\Temp\\pip-install-ii8ti1lp\\pybgs_4f048535b22c4fd299172823d5938fb6\\setup.py'"'"'; __file__='"'"'C:\\Users\\quent\\AppData\\Local\\Temp\\pip-install-ii8ti1lp\\pybgs_4f048535b22c4fd299172823d5938fb6\\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\quent\AppData\Local\Temp\pip-record-szv2k3di\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\pybgs'
cwd: C:\Users\quent\AppData\Local\Temp\pip-install-ii8ti1lp\pybgs_4f048535b22c4fd299172823d5938fb6\
Complete output (61 lines):
running install
running build
running build_ext
Preparing the build environment
Configuring cmake project
C:\Program Files\CMake\bin\cmake.exe -HC:\Users\quent\AppData\Local\Temp\pip-install-ii8ti1lp\pybgs_4f048535b22c4fd299172823d5938fb6 -Bbuild\temp.win-amd64-3.8\Release -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DBGS_CORE_STATIC=ON -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_ONLY=ON -DBGS_PYTHON_VERSION=3.8
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.28.29915.0
-- The CXX compiler identification is MSVC 19.28.29915.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/Community/VC/Tools/MSVC/14.28.29910/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/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- BGS_PYTHON_SUPPORT: ON
-- BGS_PYTHON_ONLY: ON
-- BGS_CORE_STATIC: ON
-- PYTHON VERSION: 3.8
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: vc15
-- OpenCV STATIC: OFF
-- Found OpenCV: C:/Users/quent/Downloads/opencv/build (found version "4.5.2")
-- Found OpenCV 4.5.2 in C:/Users/quent/Downloads/opencv/build/x64/vc15/lib
-- You might need to add C:\Users\quent\Downloads\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
--
-- OpenCV library status:
-- version: 4.5.2
-- libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_world
-- include path: C:/Users/quent/Downloads/opencv/build/include
-- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found suitable version "3.8.8", minimum required is "3.8")
-- Found PythonLibs: C:/ProgramData/Anaconda3/libs/Python38.lib
-- pybind11 v2.3.dev1
--
-- Python library status:
-- executable: C:/ProgramData/Anaconda3/python.exe
-- library:
-- include path: C:/ProgramData/Anaconda3/include
-- NUMPY_INCLUDE_DIR: C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\include
-- Bulding bgslibrary_core STATIC
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/quent/AppData/Local/Temp/pip-install-ii8ti1lp/pybgs_4f048535b22c4fd299172823d5938fb6/build/temp.win-amd64-3.8/Release
Building binaries
C:\Program Files\CMake\bin\cmake.exe --build build\temp.win-amd64-3.8\Release --config Release -- -j8
Microsoft (R) Build Engine version 16.9.0+5e4b48a27 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits r‚serv‚s.
MSBUILD : error MSB1001: Commutateur inconnu.
Commutateurÿ:ÿ-j8
Pour la syntaxe du commutateur, tapez "MSBuild -help"
error: command 'C:\\Program Files\\CMake\\bin\\cmake.exe' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\quent\\AppData\\Local\\Temp\\pip-install-ii8ti1lp\\pybgs_4f048535b22c4fd299172823d5938fb6\\setup.py'"'"'; __file__='"'"'C:\\Users\\quent\\AppData\\Local\\Temp\\pip-install-ii8ti1lp\\pybgs_4f048535b22c4fd299172823d5938fb6\\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\quent\AppData\Local\Temp\pip-record-szv2k3di\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\pybgs' Check the logs for full command output.
error: command 'cmake' failed: No such file or directory
you dont have CMake installed or its not available in PATH when you try to install pybgs.
https://github.com/andrewssobral/bgslibrary/wiki/Installation-instructions---Windows clearly indicates that you need:
* OpenCV 2.4.x, 3.4.x, 4.x
* Visual Studio 2013, 2015, 2017
* CMake 3.12 or higher
if you have those installed, you probably need to activate dev prompt for visual studio..

I am using python 3.9 and I can't figure out how to install pyaudio in my Windows 10

Currently using Visual Studio Code
Tried using pip install pyaudio but it simply gave an error like:
PS C:\Users\NIKHIL> pip install pyaudio
Defaulting to user installation because normal site-packages is
not writeable
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NIKHIL\\AppData\\Local\\Temp\\pip-install-yo0mmwlt\\pyaudio_d4ca14ee2a5246debede93cab086f909\\setup.py'"'"'; __file__='"'"'C:\\Users\\NIKHIL\\AppData\\Local\\Temp\\pip-install-yo0mmwlt\\pyaudio_d4ca14ee2a5246debede93cab086f909\\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\NIKHIL\AppData\Local\Temp\pip-wheel-cbxwzcr9'
cwd: C:\Users\NIKHIL\AppData\Local\Temp\pip-install-yo0mmwlt\pyaudio_d4ca14ee2a5246debede93cab086f909\
Complete output (9 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NIKHIL\\AppData\\Local\\Temp\\pip-install-yo0mmwlt\\pyaudio_d4ca14ee2a5246debede93cab086f909\\setup.py'"'"'; __file__='"'"'C:\\Users\\NIKHIL\\AppData\\Local\\Temp\\pip-install-yo0mmwlt\\pyaudio_d4ca14ee2a5246debede93cab086f909\\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\NIKHIL\AppData\Local\Temp\pip-record-u900rrya\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\NIKHIL\AppData\Roaming\Python\Python39\Include\pyaudio'
cwd: C:\Users\NIKHIL\AppData\Local\Temp\pip-install-yo0mmwlt\pyaudio_d4ca14ee2a5246debede93cab086f909\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\NIKHIL\\AppData\\Local\\Temp\\pip-install-yo0mmwlt\\pyaudio_d4ca14ee2a5246debede93cab086f909\\setup.py'"'"'; __file__='"'"'C:\\Users\\NIKHIL\\AppData\\Local\\Temp\\pip-install-yo0mmwlt\\pyaudio_d4ca14ee2a5246debede93cab086f909\\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\NIKHIL\AppData\Local\Temp\pip-record-u900rrya\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\NIKHIL\AppData\Roaming\Python\Python39\Include\pyaudio' Check the logs for full command
output.
please suggest a way out of this
You can also try to install it with the .whl file.
Find your Python version
64 or 32 bit?
Find the appropriate file here
For example, my Python version is the 3.9 64bit I would download the "PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl" file.
Open your CMD and go to the folder where the file is. Ex.: cd C:\Users\Miguel\Downloads
Install it: pip install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
Hope it helped!
This answer from a StackOverflow question might help, as I had the same problem and it solved the problem for me.
First run your IDE or CMD as Administrator and run the following:
pip install pipwin
pipwin install pyaudio
Try these commands below:
pip install pipwin
pipwin install pyaudio
Looking at the error message it seems you require Visual C++ build tools.
The link to download that is also given within that error message.
In case the link does not work,You can download it here: https://visualstudio.microsoft.com/visual-cpp-build-tools/
You can try this and incase errors still persist, reply to this thread.
Upvote if it helped!
PyAudio just doesn't have the wheels for Python 3.7 or higher. If you want to use PyAudio, it is best to download python version 3.6.9 here.
I wish you the best
-arivvid27
I tried with Python 3.9 and didn´t work, so I installed Python 3.8 too and pyaudio worked fine (I've double checked and downloaded both versions of pyaudio on https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio).
I still don't know why it doesn't work on 3.9.
Did it work for someone on python 3.9? If yes, let me know what did you do. Thanks!
you should use python 3.6.9 or lower

Pip install qiskit: Command errored out with exit status 255:

I am trying to install Qiskit on elementaryOS juno running Python 3.7, using pip. I even upgraded to the latest pip.
I get the following log:
Building wheels for collected packages: qiskit
Building wheel for qiskit (setup.py) ... error
ERROR: Command errored out with exit status 255:
command: /home/laura/.pyenv/versions/anaconda3-2019.03/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p35oetbg/qiskit/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p35oetbg/qiskit/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 /tmp/pip-wheel-2ms47shp --python-tag cp37
cwd: /tmp/pip-install-p35oetbg/qiskit/
Complete output (1 lines):
running bdist_wheel
----------------------------------------
ERROR: Failed building wheel for qiskit
Running setup.py clean for qiskit
Failed to build qiskit
Installing collected packages: qiskit
Running setup.py install for qiskit ... done
Successfully installed qiskit-0.11.0
This error seems to be reported by various users as per issue log in the Qiskit GitHub repository. Could you please try the following steps.
Install Anaconda
Create a python 3.7 environment: conda create --name your_env python=3.7
conda activate your_env
pip install qiskit
You can report the specific details of the issues in the following GitHub repository issue log if it is persisting after following these steps.
Qiskit GitHub Repository Issue Log

Error in installing jsonlib in python using cmd

I was trying to install the jsonlib in python using pip install, but the error keeps coming
I've tried installing the Visual Studio C++ redis. 2015-2019.
It did nothing.
Using cached https://files.pythonhosted.org/packages/7c/55/19c29fd79dfb5d42f4568feedc5a286d01d0683a372c1e19024531576508/jsonlib-1.6.1.tar.gz
Building wheels for collected packages: jsonlib
Building wheel for jsonlib (setup.py) ... error
ERROR: Complete output from command 'c:\users\satyam porwal\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Satyam Porwal\\AppData\\Local\\Temp\\pip-install-w6n5pwbu\\jsonlib\\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\Satyam Porwal\AppData\Local\Temp\pip-wheel-l33ly_ta' --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying jsonlib.py -> build\lib.win-amd64-3.7
running build_ext
building '_jsonlib' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for jsonlib
Running setup.py clean for jsonlib
Failed to build jsonlib
Installing collected packages: jsonlib
Running setup.py install for jsonlib ... error
I expected to install the json
pipwin installs unofficial python package binaries for windows
provided by Christoph Gohlke here
pip install pipwin
pipwin install jsonlib
This worked for python 3.x oon windows
pip install pipwin
pipwin install jsonlib-python3

pip install tesserocr on windows 10 gives error

I am trying to install tesserocr package for python on Windows10 host OS
i am getting following error
pip install tesserocr
execution
pip install tesserocr
Collecting tesserocr
Using cached tesserocr-2.1.3.tar.gz
Building wheels for collected packages: tesserocr
Running setup.py bdist_wheel for tesserocr ... error
Complete output from command "C:\Program Files\Anaconda3\python.exe" -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\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\hp\AppData\Local\Temp\tmpoyt9eh40pip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_ext
Failed to extract tesseract version from executable: [WinError 2] The
system cannot find the file specified
Supporting tesseract v3.04.00
Building with configs: {'libraries': ['tesseract', 'lept'],
'cython_compile_time_env': {'TESSERACT_VERSION': 197632}}
cythoning tesserocr.pyx to tesserocr.cpp
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft
Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-
build-tools
----------------------------------------
Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... error
Complete output from command "C:\Program Files\Anaconda3\python.exe" -u
-c "import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\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\hp\AppData\Local\Temp\pip-
10ema0ny-record\install-record.txt --single-version-externally-managed --
compile:
running install
running build
running build_ext
Failed to extract tesseract version from executable: [WinError 2] The system cannot find the file specified
Supporting tesseract v3.04.00
Building with configs: {'cython_compile_time_env': {'TESSERACT_VERSION': 197632}, 'libraries': ['tesseract', 'lept']}
skipping 'tesserocr.cpp' Cython extension (up-to-date)
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command ""C:\Program Files\Anaconda3\python.exe" -u -c "import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\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\hp\AppData\Local\Temp\pip-
10ema0ny-record\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in C:\Users\hp\AppData\Local\Temp\pip-
build-klj3zdup\tesserocr\
how to overcome this isuue?
As you can see from the error log, the problem here is that on your machine is missing Microsoft Visual C++ 14.0.
To fix this problem, simply install it, follow the link that you find in the traceback (this one), and try again with the command
pip install tesserocr
Reload Python directly with Anaconda, and use:
conda install -c simonflueckiger tesserocr

Categories