How to solve pip installation command - python-3.x

I have problem with the python speech recognization problem and audio libraries
This is on the windows system
import speach_recognition as sr
r =sr.Recognizer()
with sr.Microphone() as source:
print("Speak Anything")
audio = r.listen(source)
try:
text = r.recognize_google(audio)
print('you said : {}'.format(text))
except:
print('sorry could not recognized voice')
C:\Users\DELL> pip install audio Collecting audio Using cached
https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: audio Building wheel for
pyaudio (setup.py) ... error ERROR: Complete output from command
'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools,
tokenize;file='"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-1gm3suw5\pyaudio\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\DELL\AppData\Local\Temp\pip-wheel-ke5zzs2d'
--python-tag cp37: ERROR: running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7 running build_ext
building '_portaudio' 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 pyaudio Running setup.py clean for pyaudio Failed to build
pyaudio Installing collected packages: pyaudio Running setup.py
install for audio ... error
ERROR: Complete output from command 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools,
tokenize;file='"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-1gm3suw5\pyaudio\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\DELL\AppData\Local\Temp\pip-record-e6fzeo61\install-record.txt'
--single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":
https://visualstudio.microsoft.com/downloads/
---------------------------------------- ERROR: Command "'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools,
tokenize;file='"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-1gm3suw5\pyaudio\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\DELL\AppData\Local\Temp\pip-record-e6fzeo61\install-record.txt'
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\DELL\AppData\Local\Temp\pip-install-1gm3suw5\pyaudio\

As your error indicates:
Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
You need to install MS Visual C++ 14.0 compiler so that the C++ dependencies can be built (detailed instruction here).
Another option is (following advice from this answer) to use an unofficial library of compiled Windows dependencies for Python packages from Unofficial Windows Binaries for Python Extension Packages.

Related

Not able to download dlib using pip3 or Pip

Trying to download dlib using pip3 install dlib command but getting below exception. HOw to resolve below issue?
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: 'C:\PATH\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Shiladittya\\AppData\\Local\\Temp\\pip-install-40do86q8\\dlib_b343cff879474b048ae9f0f7abe0c9ae\\setup.py'"'"'; __file__='"'"'C:\\Users\\Shiladittya\\AppData\\Local\\Temp\\pip-install-40do86q8\\dlib_b343cff879474b048ae9f0f7abe0c9ae\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Shiladittya\AppData\Local\Temp\pip-wheel-2kmgy0vh'
cwd: C:\PATH\\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\
Complete output (58 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.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\PATH\\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Shiladittya\AppData\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\Shiladittya\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Shiladittya\AppData\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\build\lib.win-amd64-3.9 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (message):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You must use Visual Studio to build a python extension on windows. If you
are getting this error it means you have not installed Visual C++. Note
that there are many flavors of Visual Studio, like Visual Studio for C#
development. You need to install Visual Studio for C++.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "<string>", line 1, in <module>
I faced the same issue so what I did I preferred youtube and watched in one video I am sharing the link to that video that might help
Video Link
for short I download visual studio downloader and installed C++ dependencies and first I installed CMake then dlib because dlib takes C++ dependencies then I choose the specified version of dlib and it worked fine but if still, it doesn't work so again
I would recommend using conda environment in conda it works properly but make sure to use basic dependencies (C++ and Cmake)

I am not getting the installation of the pyaudio library into my system

This is the output:
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Command "c:\users\vishwas\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Vishwas\\AppData\\Local\\Temp\\pip-install-g9skf8fa\\PyAudio\\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\Vishwas\AppData\Local\Temp\pip-record-8gf9jsxc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Vishwas\AppData\Local\Temp\pip-install-g9skf8fa\PyAudio\
"Where is it releated to python and c++"
I have tried all the methods even easy_install but didn't work:
pip install PyAudio
Collecting PyAudio Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Installing collected packages: PyAudio Running setup.py install for PyAudio ... error Complete output from command c:\users\vishwas\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Vishwas\\AppData\\Local\\Temp\\pip-install-g9skf8fa\\PyAudio\\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\Vishwas\AppData\Local\Temp\pip-record-8gf9jsxc\install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build\lib.win-amd64-3.7 copying src\pyaudio.py -> build\lib.win-amd64-3.7 running build_ext building '_portaudio' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- Command "c:\users\vishwas\appdata\local\programs\python\python37\python.exe -u -c
"import setuptools, tokenize;__file__='C:\\Users\\Vishwas\\AppData\\Local\\Temp\\pip-install-g9skf8fa\\PyAudio\\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\Vishwas\AppData\Local\Temp\pip-record-8gf9jsxc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Vishwas\AppData\Local\Temp\pip-install-g9skf8fa\PyAudio\
It looks like the buildtools from Micrsoft Studio are required for some dependencies. So should be no problem to install them from the links in the error message.

Unable to install fbprophet package in python 3

While trying to install fbprophet package in windows 10 64 bit operating system machine using pip install fbprophet, I am facing few errors
Failed building wheel for ephem
Failed to build fbprophet ephem
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\lenovo\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-be8bzm_6\\ephem\\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\lenovo\AppData\Local\Temp\pip-record-w_5d9n03\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\lenovo\AppData\Local\Temp\pip-install-be8bzm_6\ephem\

How to install ChainerCV

I am using Win 10. I tried installing ChainerCV through pip. I want to know what can be done to solve this problem. Also what is behind this issue: not having VisualStudio, dependency issues or any other thing. Is having CUDA necessary to run ChainerCV?
P.S I have chainer and other dependencies running properly.
Stack Trace:
copying chainercv\utils\bbox_nms_gpu_post.c -> build\lib.win-amd64-3.5\chainercv\utils\bbox
running build_ext
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Failed building wheel for chainercv
Running setup.py clean for chainercv
Failed to build chainercv
Installing collected packages: chainercv
Running setup.py install for chainercv ... error
Complete output from command c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\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\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile:
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\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\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\
are you trying on admin ? else please follow below steps
open cmd using Ctrl + r then type cmd and try to install from there
pip install ChainerCV

Error while installing pymssql on windows 10

I'm getting "The system cannot find the path specified" error.
Could anyone give me some hint about how to make the path correct?
I've never encountered this type of error before while I'm using pip.
C:\Users\ahkim>pip install pymssql
Collecting pymssql
Downloading pymssql-2.1.3.tar.gz (897kB)
100% |████████████████████████████████| 901kB 1.9MB/s
Building wheels for collected packages: pymssql
Running setup.py bdist_wheel for pymssql ... error
Complete output from command C:\Users\ahkim\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ahkim\\AppData\\Local\\Temp\\pip-build-mfok55b5\\pymssql\\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\ahkim\AppData\Local\Temp\tmp127kpd9epip-wheel- --python-tag cp36:
setup.py: platform.system() => 'Windows'
setup.py: platform.architecture() => ('64bit', 'WindowsPE')
running bdist_wheel
running build
running build_ext
building '_mssql' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Failed building wheel for pymssql
Running setup.py clean for pymssql
Failed to build pymssql
Installing collected packages: pymssql
Running setup.py install for pymssql ... error
Complete output from command C:\Users\ahkim\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ahkim\\AppData\\Local\\Temp\\pip-build-mfok55b5\\pymssql\\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\ahkim\AppData\Local\Temp\pip-r247wrkl-record\install-record.txt --single-version-externally-managed --compile:
setup.py: platform.system() => 'Windows'
setup.py: platform.architecture() => ('64bit', 'WindowsPE')
running install
running build
running build_ext
cythoning _mssql.pyx to _mssql.c
warning: _mssql.pyx:143:4: Exception already a builtin Cython type
building '_mssql' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Command "C:\Users\ahkim\AppData\Local\Continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ahkim\\AppData\\Local\\Temp\\pip-build-mfok55b5\\pymssql\\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\ahkim\AppData\Local\Temp\pip-r247wrkl-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ahkim\AppData\Local\Temp\pip-build-mfok55b5\pymssql\
look this https://learn.microsoft.com/en-us/sql/connect/python/pymssql/step-1-configure-development-environment-for-pymssql-python-development
For choose right file to download you must determine number of cp
Ex : cp27 , cp36 and so on
import pip
print(pip.pep425tags.get_supported())
like this :
enter image description here
Person who using Python through anaconda, should run below code in anaconda command line, as admin.
conda install pymssql.
I have testing and worked fine, this will take roughly 20-30 mins while it will also install all other dependencies.

Resources