got an error while installing pyodbc in virtual enviornment - python

I have created a virtual environment for flask development.now, I want to install pyodbc to connect with sql server. I tried to install with pip install pyodbc in my virtual environment. I got following error-
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/75/29/aa190749bac37ede0f11a68a75e7055254699c11572bd94213f1163dfd8f/pyodbc-4.0.27.tar.gz
Building wheels for collected packages: pyodbc
Building wheel for pyodbc (setup.py) ... error
>ERROR: Command errored out with exit status 1:
command: 'C:\Users\bitre\Anaconda3\envs\flaskEnv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\bitre\\AppData\\Local\\Temp\\pip-install-313n7fr3\\pyodbc\\setup.py'"'"'; __file__='"'"'C:\\Users\\bitre\\AppData\\Local\\Temp\\pip-install-313n7fr3\\pyodbc\\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\bitre\AppData\Local\Temp\pip-wheel-49fya41s' --python-tag cp38
cwd: C:\Users\bitre\AppData\Local\Temp\pip-install-313n7fr3\pyodbc\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
>ERROR: Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\bitre\Anaconda3\envs\flaskEnv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\bitre\\AppData\\Local\\Temp\\pip-install-313n7fr3\\pyodbc\\setup.py'"'"'; __file__='"'"'C:\\Users\\bitre\\AppData\\Local\\Temp\\pip-install-313n7fr3\\pyodbc\\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\bitre\AppData\Local\Temp\pip-record-645ww_jo\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\bitre\AppData\Local\Temp\pip-install-313n7fr3\pyodbc\
Complete output (5 lines):
running install
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\bitre\Anaconda3\envs\flaskEnv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\bitre\\AppData\\Local\\Temp\\pip-install-313n7fr3\\pyodbc\\setup.py'"'"'; __file__='"'"'C:\\Users\\bitre\\AppData\\Local\\Temp\\pip-install-313n7fr3\\pyodbc\\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\bitre\AppData\Local\Temp\pip-record-645ww_jo\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I tried outside virtual Environment,
Requirement already satisfied: pyodbc in c:\users\bitre\anaconda3\lib\site-packages (4.0.26)

You can try installing using this command if anaconda as a base in virtual environment-:
conda install -c anaconda pyodbc

Related

"ERROR: CMake must be installed to build dlib" when installing face_recognition

I'm facing this error while installing face_recognition in a virtualenv with Python 3.8.10 on Ubuntu 20.04.
ERROR: Failed building wheel for face-recognition-models
Running setup.py clean for face-recognition-models
Failed to build dlib face-recognition-models
Installing collected packages: Click, numpy, dlib, face-recognition-models, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/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 /tmp/pip-record-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib'
cwd: /tmp/pip-install-tai2snq9/dlib/
Complete output (8 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
ERROR: CMake must be installed to build dlib
----------------------------------------
ERROR: Command errored out with exit status 1: '/home/badrelden/Desktop/test python sound/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tai2snq9/dlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tai2snq9/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 /tmp/pip-record-bhy0sde6/install-record.txt --single-version-externally-managed --compile --install-headers '/home/badrelden/Desktop/test python sound/venv/include/site/python3.8/dlib' Check the logs for full command output.
ERROR: CMake must be installed to build dlib
This is the key part of the error message. You need to install cmake, which can be done by running sudo apt install cmake on Debian-based systems, including Ubuntu. After cmake is installed, you can rerun the pip install command.

when i install pip install pyaudio its getting error [duplicate]

This question already has answers here:
Pip error: Microsoft Visual C++ 14.0 is required
(13 answers)
Closed 2 years ago.
C:\Users\ABC>pip install pyaudio
Collecting pyaudio
Downloading PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\abc\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ABC\\AppData\\Local\\Temp\\pip-install-_y3fknpl\\pyaudio_cfd10ebeac564e77949993d585b75b18\\setup.py'"'"'; __file__='"'"'C:\\Users\\ABC\\AppData\\Local\\Temp\\pip-install-_y3fknpl\\pyaudio_cfd10ebeac564e77949993d585b75b18\\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\ABC\AppData\Local\Temp\pip-record-ue5ei1nt\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\abc\appdata\local\programs\python\python39\Include\pyaudio'
cwd: C:\Users\ABC\AppData\Local\Temp\pip-install-_y3fknpl\pyaudio_cfd10ebeac564e77949993d585b75b18\
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 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\abc\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ABC\\AppData\\Local\\Temp\\pip-install-_y3fknpl\\pyaudio_cfd10ebeac564e77949993d585b75b18\\setup.py'"'"'; __file__='"'"'C:\\Users\\ABC\\AppData\\Local\\Temp\\pip-install-_y3fknpl\\pyaudio_cfd10ebeac564e77949993d585b75b18\\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\ABC\AppData\Local\Temp\pip-record-ue5ei1nt\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\abc\appdata\local\programs\python\python39\Include\pyaudio' Check the logs for full command output
It's telling you, in the error message, Microsoft Visual C++ 14.0 is required. You should install it. You haven't indicated that you have or haven't installed it, so if you have, you should specify that that's your issue. It seems like the issue is that you just didn't read the error message though.

CMD is not installing my packages using pip

Having errors on cmd as admin trying to install new modules even re-installed python to get newest version, and keeps failing!
Modules I have tried
pip install pyaudio
pip install smtplib
AND MANY Others
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
ERROR: Command errored out with exit status 1:
command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\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\marcu\AppData\Local\Temp\pip-record-dwdolxb5\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\marcu\AppData\Local\Temp\pip-install-9lkkindd\pyaudio\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-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 errored out with exit status 1: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcu\\AppData\\Local\\Temp\\pip-install-9lkkindd\\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\marcu\AppData\Local\Temp\pip-record-dwdolxb5\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
yes you must download visual c++ 14 on microsoft website(optionnal) before! try after install
update your pip also!
try this link https://www.techspot.com/downloads/6776-visual-c-redistributable-package.html

pip install python-pyaudio fails on Windows [duplicate]

This question already has answers here:
Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"
(36 answers)
Closed 3 years ago.
cannot install pyaudio in command prompt.
pip install pyaudio
python -m pip install PyAudio
python pip install python-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
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Nivin\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\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\Nivin\AppData\Local\Temp\pip-record-qs3g__i9\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Nivin\AppData\Local\Temp\pip-install-792muqk4\PyAudio\
Complete output (9 lines):
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 errored out with exit status 1: 'C:\Users\Nivin\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\PyAudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nivin\\AppData\\Local\\Temp\\pip-install-792muqk4\\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\Nivin\AppData\Local\Temp\pip-record-qs3g__i9\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Installing pyaudio from source requires MSVC Build tools to be installed on the machine so you need to install it first.
Another alternative is to grab a pre-built wheel package from here and install it via pip:
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl

Unable to install PyAudio on windows 10

I have tried installing pyaudio on Windows 10 but I am getting the following errors:
pip install python-pyaudio
Collecting python-pyaudio
ERROR: Could not find a version that satisfies the requirement python-pyaudio (from versions: none)
ERROR: No matching distribution found for python-pyaudio
C:\Users\lenovo>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
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-d7mfqufu\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-d7mfqufu\\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\lenovo\AppData\Local\Temp\pip-record-26rv078i\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-d7mfqufu\pyaudio\
Complete output (9 lines):
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": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\program files\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-d7mfqufu\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-d7mfqufu\\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\lenovo\AppData\Local\Temp\pip-record-26rv078i\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
Any suggestions on what to try to fix this?
You need to install Microsoft Visual c++ 14.0, you can get it here: http://landinghub.visualstudio.com/visual-cpp-build-tools

Categories

Resources