Can't import PyAudio to PyCharm project - python

I can access it in the terminal but when I try to add it to my python project in PyCharm it won't let me
I have tried with both python 3.10 and 3.9
it also shows this when i ask for details on why it doesn't work
Collecting PyAudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: PyAudio
Building wheel for PyAudio (setup.py): started
Building wheel for PyAudio (setup.py): finished with status 'error'
Running setup.py clean for PyAudio
Failed to build PyAudio
Installing collected packages: PyAudio
Running setup.py install for PyAudio: started
Running setup.py install for PyAudio: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Lenovo\PycharmProjects\Alexa2\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-bl692lay\\pyaudio_da329c95486d497b95d33a9225fb1595\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-bl692lay\\pyaudio_da329c95486d497b95d33a9225fb1595\\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\Lenovo\AppData\Local\Temp\pip-wheel-qtpqe2of'
cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-install-bl692lay\pyaudio_da329c95486d497b95d33a9225fb1595\
Complete output (11 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
copying src\pyaudio.py -> build\lib.win-amd64-3.10
warning: build_py: byte-compiling is disabled, skipping.
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
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Lenovo\PycharmProjects\Alexa2\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-bl692lay\\pyaudio_da329c95486d497b95d33a9225fb1595\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-bl692lay\\pyaudio_da329c95486d497b95d33a9225fb1595\\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'"'"'))' install --record 'C:\Users\Lenovo\AppData\Local\Temp\pip-record-p3n5y632\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Lenovo\PycharmProjects\Alexa2\venv\include\site\python3.10\PyAudio'
cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-install-bl692lay\pyaudio_da329c95486d497b95d33a9225fb1595\
Complete output (11 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
copying src\pyaudio.py -> build\lib.win-amd64-3.10
warning: build_py: byte-compiling is disabled, skipping.
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:\Users\Lenovo\PycharmProjects\Alexa2\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-bl692lay\\pyaudio_da329c95486d497b95d33a9225fb1595\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\pip-install-bl692lay\\pyaudio_da329c95486d497b95d33a9225fb1595\\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'"'"'))' install --record 'C:\Users\Lenovo\AppData\Local\Temp\pip-record-p3n5y632\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Lenovo\PycharmProjects\Alexa2\venv\include\site\python3.10\PyAudio' Check the logs for full command output.
WARNING: You are using pip version 21.1.2; however, version 22.0.3 is available.
You should consider upgrading via the 'C:\Users\Lenovo\PycharmProjects\Alexa2\venv\Scripts\python.exe -m pip install --upgrade pip' command.
edit:
now it says:
Command errored out with exit status 1
rather then the warning about c++ visual tools

The error indicates 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/. You should install this to proceed.

Related

how to fix pip install pyodbc error in python3.5.2? [duplicate]

This question already has answers here:
Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"
(36 answers)
Error while installing lxml through pip: Microsoft Visual C++ 14.0 is required
(8 answers)
Pip error even Microsoft Visual C++ 14.0 is installed
(4 answers)
How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages?
(9 answers)
Closed last year.
how to fix
Collecting pyodbc
Using cached pyodbc-4.0.32.tar.gz (280 kB)
Preparing metadata (setup.py) ... doneBuilding wheels for collected packages:
pyodbc
Building wheel for pyodbc (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4\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\Hp\AppData\Local\Temp\pip-wheel-ukv030lp'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'pyodbc' 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 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\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4\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'"'"'))' install --record 'C:\Users\Hp\AppData\Local\Temp\pip-record-6iqibsw_\innally-managed --compile --install-headers 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\Include\pyodbc'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4
Complete output (5 lines):
running install
running build
running build_ext
building 'pyodbc' 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:\Users\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-pduzvow4\pyodbc_6a2cb9d552294608a526333bd147a8c4\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'"'"'))' install --record 'C:\Users\Hp\AppData\Local\Temp\pip-record-6iqibsw_\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\Include\pyodbc' Check the logs for full command output.
PS C:\Users\Hp\Desktop\testing> pip install pyodbc
Collecting pyodbc
Using cached pyodbc-4.0.32.tar.gz (280 kB)
Preparing metadata (setup.py) ... doneBuilding wheels for collected packages:
pyodbc
Building wheel for pyodbc (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd\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\Hp\AppData\Local\Temp\pip-wheel-hgzmffmb'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'pyodbc' 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 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\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd\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'"'"'))' install --record 'C:\Users\Hp\Anally-managed --compile --install-headers 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\Include\pyodbc'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd
Complete output (5 lines):
running install
running build
running build_ext
building 'pyodbc' 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:\Users\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-qh0u8ubs\pyodbc_065570aa41d54e39975cd28d9b1bd1cd\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'"'"'))' install --record 'C:\Users\Hp\AppData\Local\Temp\pip-record-_x_xavqf\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\Include\pyodbc' Check the logs for full command output.
PS C:\Users\Hp\Desktop\testing> pip install pyodbc
Collecting pyodbc
Using cached pyodbc-4.0.32.tar.gz (280 kB)
Preparing metadata (setup.py) ... doneBuilding wheels for collected packages:
pyodbc
Building wheel for pyodbc (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f\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\Hp\AppData\Local\Temp\pip-wheel-0xd6a19l'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'pyodbc' 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 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\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f\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'"'"'))' install --record 'C:\Users\Hp\AppData\Local\Temp\pip-record-0mfty8o5\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\Include\pyodbc'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f
Complete output (5 lines):
running install
running build
running build_ext
building 'pyodbc' 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:\Users\Hp\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-z16aosoo\pyodbc_04a9c3beea8a421ea0d1796cca1ec22f\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'"'"'))' install --record 'C:\Users\Hp\AppData\Local\Temp\pip-record-0mfty8o5\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Hp\AppData\Local\Programs\Python\Python310\Include\pyodbc' Check the logs for full command output.
I believe pyodbc requires c++ to compile. That's why it's telling you that
Visual C++ 14.0 or greater is required.
Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Another option may be
pip install --only-binary :all: pyodbc

Installing OOXML library fails

I am trying to install OOXML with Python 3.10 using pip install ooxml
First of all, I did create a new virtual environment (after installing virtualenv), then activated it with env\Scripts\activate
but I am getting this error:
(env) PS C:\Users\ahmad\Desktop\XML-DOCX> pip install ooxml
Collecting ooxml
Using cached ooxml-0.2.1.tar.gz (4.3 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: ooxml
Building wheel for ooxml (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\ahmad\Desktop\XML-DOCX\env\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"'; __file__='"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\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\ahmad\AppData\Local\Temp\pip-wheel-cw6u77ak'
cwd: C:\Users\ahmad\AppData\Local\Temp\pip-install-r6q4bs_b\ooxml_5b43566139ba4321a491b2ef7c9bdf16\
Complete output (26 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\ooxml
copying ooxml\ooxmlbase.py -> build\lib\ooxml
copying ooxml\spreadsheet.py -> build\lib\ooxml
copying ooxml\__init__.py -> build\lib\ooxml
C:\Users\ahmad\Desktop\XML-DOCX\env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
installing to build\bdist.win-amd64\wheel
running install
running install_lib
creating build\bdist.win-amd64
creating build\bdist.win-amd64\wheel
creating build\bdist.win-amd64\wheel\ooxml
copying build\lib\ooxml\ooxmlbase.py -> build\bdist.win-amd64\wheel\.\ooxml
copying build\lib\ooxml\spreadsheet.py -> build\bdist.win-amd64\wheel\.\ooxml
copying build\lib\ooxml\__init__.py -> build\bdist.win-amd64\wheel\.\ooxml
running install_data
creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data
creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data\data
creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data\data\ooxml
creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data\data\ooxml\ooxml-templates
error: can't copy 'ooxml\ooxml-templates\workbook.xlsx': doesn't exist or not a regular file
----------------------------------------
ERROR: Failed building wheel for ooxml
Running setup.py clean for ooxml
Failed to build ooxml
Installing collected packages: ooxml
Running setup.py install for ooxml ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\ahmad\Desktop\XML-DOCX\env\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"'; __file__='"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\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'"'"'))' install --record 'C:\Users\ahmad\AppData\Local\Temp\pip-record-44ixgoxr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\ahmad\Desktop\XML-DOCX\env\include\site\python3.10\ooxml'
cwd: C:\Users\ahmad\AppData\Local\Temp\pip-install-r6q4bs_b\ooxml_5b43566139ba4321a491b2ef7c9bdf16\
Complete output (16 lines):
running install
C:\Users\ahmad\Desktop\XML-DOCX\env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib
creating build\lib\ooxml
copying ooxml\ooxmlbase.py -> build\lib\ooxml
copying ooxml\spreadsheet.py -> build\lib\ooxml
copying ooxml\__init__.py -> build\lib\ooxml
running install_lib
running install_data
creating C:\Users\ahmad\Desktop\XML-DOCX\env\ooxml
creating C:\Users\ahmad\Desktop\XML-DOCX\env\ooxml\ooxml-templates
error: can't copy 'ooxml\ooxml-templates\workbook.xlsx': doesn't exist or not a regular file
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\ahmad\Desktop\XML-DOCX\env\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"'; __file__='"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\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'"'"'))' install --record 'C:\Users\ahmad\AppData\Local\Temp\pip-record-44ixgoxr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\ahmad\Desktop\XML-DOCX\env\include\site\python3.10\ooxml' Check the logs for full command output.
I could not locate logs to determine where the installation is failing, any help?
The subdirectory ooxml\ooxml-templates\ is missing from ooxml-0.2.1.tar.gz. This is a bug in the distribution package.
Try to install from the Github repository:
pip install git+https://github.com/wensheng/PyOOXML.git

I am getting an error while installing zBar

I'm getting an error installing the zbar module. I think the error is related to authorization. How can I solve it?
I wrote pip install zbar.
C:\Users\emiry>pip install zbar
Collecting zbar
Using cached zbar-0.10.zip (31 kB)
Building wheels for collected packages: zbar
Building wheel for zbar (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\emiry\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\emiry\\AppData\\Local\\Temp\\pip-install-6i6ygv4e\\zbar_700c50e90f604c658bec553c6d356553\\setup.py'"'"'; __file__='"'"'C:\\Users\\emiry\\AppData\\Local\\Temp\\pip-install-6i6ygv4e\\zbar_700c50e90f604c658bec553c6d356553\\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\emiry\AppData\Local\Temp\pip-wheel-spwm2dxx'
cwd: C:\Users\emiry\AppData\Local\Temp\pip-install-6i6ygv4e\zbar_700c50e90f604c658bec553c6d356553\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
building 'zbar' 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 zbar
Running setup.py clean for zbar
Failed to build zbar
Installing collected packages: zbar
Running setup.py install for zbar ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\emiry\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\emiry\\AppData\\Local\\Temp\\pip-install-6i6ygv4e\\zbar_700c50e90f604c658bec553c6d356553\\setup.py'"'"'; __file__='"'"'C:\\Users\\emiry\\AppData\\Local\\Temp\\pip-install-6i6ygv4e\\zbar_700c50e90f604c658bec553c6d356553\\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'"'"'))' install --record 'C:\Users\emiry\AppData\Local\Temp\pip-record-7pxl18hx\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\emiry\AppData\Local\Programs\Python\Python39\Include\zbar'
cwd: C:\Users\emiry\AppData\Local\Temp\pip-install-6i6ygv4e\zbar_700c50e90f604c658bec553c6d356553\
Complete output (5 lines):
running install
running build
running build_ext
building 'zbar' 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:\Users\emiry\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\emiry\\AppData\\Local\\Temp\\pip-install-6i6ygv4e\\zbar_700c50e90f604c658bec553c6d356553\\setup.py'"'"'; __file__='"'"'C:\\Users\\emiry\\AppData\\Local\\Temp\\pip-install-6i6ygv4e\\zbar_700c50e90f604c658bec553c6d356553\\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'"'"'))' install --record 'C:\Users\emiry\AppData\Local\Temp\pip-record-7pxl18hx\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\emiry\AppData\Local\Programs\Python\Python39\Include\zbar' Check the logs for full command output.
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'C:\Users\emiry\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.
You need to install MS C++ Visual Build tools with Studio. This is link:- https://visualstudio.microsoft.com/vs/older-downloads/

Error Installing pyaudio: Microsoft Visual C++ 14.0 is required

After doing pip install pyaudio, It started collecting the package but suddenly it displayed Following error
This is the error I got in the terminal
PS C:\Users\user> pip install pyaudio
Collecting pyaudio
Using cached 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\user\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-rqkofe07\\pyaudio_e2694735f99f47ea89c7f6ea2c6b1e31\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-rqkofe07\\pyaudio_e2694735f99f47ea89c7f6ea2c6b1e31\\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'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-lmei1_wv\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\user\appdata\local\programs\python\python39\Include\pyaudio'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-rqkofe07\pyaudio_e2694735f99f47ea89c7f6ea2c6b1e31\
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\user\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-rqkofe07\\pyaudio_e2694735f99f47ea89c7f6ea2c6b1e31\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-rqkofe07\\pyaudio_e2694735f99f47ea89c7f6ea2c6b1e31\\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'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-lmei1_wv\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\user\appdata\local\programs\python\python39\Include\pyaudio' Check the logs for full command output.
While the solution by #William will work, I think you should do this instead of installing ~4 gb of programs.
Go here, after that, install a suitable wheel
eg:
The suitable wheel for me is PyAudio-0.2.11-cp39-cp39-win_amd64.whl, as I have python 3.9(cp39) and it is a 64 bit installation(amd64).
After installing it in a directory (say, C:/docs), got to cmd and write
cd C:/docs
pip install PyAudio-0.2.11-cp39-cp39-win_amd64.whl
This should work
extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
The error is in your traceback, you need Microsoft Visual C++.
In order to get C++ on your computer you will need to install Visual Studio using the link in the error code: https://visualstudio.microsoft.com/downloads/

How do I solve PyAudio installation error? [duplicate]

This question already has answers here:
I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?
(17 answers)
Closed 1 year ago.
So, I was looking for some voice recognition project and I need to use the PyAudio lib, but, when installing it in Windows I just receive some erros of installation.
The method of installation that I'm using is:
pip install pyaudio
When I execute the command in cmd the result is:
command: 'c:\users\pedro\virtualenvs\pyjarvis\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pedro\\AppData\\Local\\Temp\\pip-install-tbw4bc33\\pyaudio_3d715acd64eb45979bf989d5585f978d\\setup.py'"'"'; __file__='"'"'C:\\Users\\pedro\\AppData\\Local\\Temp\\pip-install-tbw4bc33\\pyaudio_3d715acd64eb45979bf989d5585f978d\\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\pedro\AppData\Local\Temp\pip-wheel-9omziclx'
cwd: C:\Users\pedro\AppData\Local\Temp\pip-install-tbw4bc33\pyaudio_3d715acd64eb45979bf989d5585f978d\
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:\users\pedro\virtualenvs\pyjarvis\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pedro\\AppData\\Local\\Temp\\pip-install-tbw4bc33\\pyaudio_3d715acd64eb45979bf989d5585f978d\\setup.py'"'"'; __file__='"'"'C:\\Users\\pedro\\AppData\\Local\\Temp\\pip-install-tbw4bc33\\pyaudio_3d715acd64eb45979bf989d5585f978d\\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'"'"'))' install --record 'C:\Users\pedro\AppData\Local\Temp\pip-record-mzmmtmwh\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\pedro\virtualenvs\pyjarvis\include\site\python3.9\PyAudio'
cwd: C:\Users\pedro\AppData\Local\Temp\pip-install-tbw4bc33\pyaudio_3d715acd64eb45979bf989d5585f978d\
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/
That's the problem, what should I do?
Though the error says error: Microsoft Visual C++ 14.0 or greater is required. You can try installing the unofficial python binary for pyaudio from here.
Note - Install the wheel package in accordance of your system and python version.
For example if your system is of 64 bit and you running python 3.9.x then you will have to install PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
After you're done with the installation open up your terminal and navigate to the folder where the wheel package is installed, then enter the following command
pip install your_wheel_package_name.whl

Categories

Resources